> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/apis/apis/archipelago-workers/web-socket-connector-service.md).

# Web Socket Connector Service

## Get service status

> Returns service status with version, commit hash, current time, and user count

```json
{"openapi":"3.1.0","info":{"title":"Archipelago Workers API","version":"1.0.0"},"servers":[{"url":"https://archipelago-ea-stats.decentraland.org","description":"Stats service - Production"},{"url":"https://archipelago-ea-stats.zone","description":"Stats service - Development"},{"url":"https://archipelago-ea-ws-connector.decentraland.org","description":"WebSocket Connector service - Production"},{"url":"https://archipelago-ea-ws-connector.zone","description":"WebSocket Connector service - Development"}],"security":[],"paths":{"/status":{"get":{"tags":["WebSocket Connector Service"],"summary":"Get service status","description":"Returns service status with version, commit hash, current time, and user count","operationId":"getStatus","responses":{"200":{"description":"Service status","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","description":"Service version"},"commitHash":{"type":"string","description":"Git commit hash"},"currentTime":{"type":"string","format":"date-time","description":"Current server time"},"userCount":{"type":"number","description":"Number of connected users"}},"required":["version","commitHash","currentTime","userCount"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"code":{"type":"integer","description":"Error code"}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"code":{"type":"integer","description":"Error code"}},"required":["error"]}}}}}}}}}
```

## Get Prometheus metrics

> Returns Prometheus metrics for monitoring

```json
{"openapi":"3.1.0","info":{"title":"Archipelago Workers API","version":"1.0.0"},"servers":[{"url":"https://archipelago-ea-stats.decentraland.org","description":"Stats service - Production"},{"url":"https://archipelago-ea-stats.zone","description":"Stats service - Development"},{"url":"https://archipelago-ea-ws-connector.decentraland.org","description":"WebSocket Connector service - Production"},{"url":"https://archipelago-ea-ws-connector.zone","description":"WebSocket Connector service - Development"}],"security":[],"paths":{"/metrics":{"get":{"tags":["WebSocket Connector Service"],"summary":"Get Prometheus metrics","description":"Returns Prometheus metrics for monitoring","operationId":"getMetrics","responses":{"200":{"description":"Prometheus metrics","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"code":{"type":"integer","description":"Error code"}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"code":{"type":"integer","description":"Error code"}},"required":["error"]}}}}}}}}}
```

## Liveness probe

> Returns 'alive' for liveness checks

```json
{"openapi":"3.1.0","info":{"title":"Archipelago Workers API","version":"1.0.0"},"servers":[{"url":"https://archipelago-ea-stats.decentraland.org","description":"Stats service - Production"},{"url":"https://archipelago-ea-stats.zone","description":"Stats service - Development"},{"url":"https://archipelago-ea-ws-connector.decentraland.org","description":"WebSocket Connector service - Production"},{"url":"https://archipelago-ea-ws-connector.zone","description":"WebSocket Connector service - Development"}],"security":[],"paths":{"/health/live":{"get":{"tags":["WebSocket Connector Service"],"summary":"Liveness probe","description":"Returns 'alive' for liveness checks","operationId":"getLiveness","responses":{"200":{"description":"Service is alive","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"code":{"type":"integer","description":"Error code"}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"code":{"type":"integer","description":"Error code"}},"required":["error"]}}}}}}}}}
```

## WebSocket connection

> Establishes a WebSocket connection for real-time communication in the Archipelago system. This endpoint enables peer-to-peer communication, position synchronization, and island management for Decentraland clients.\
> \
> \*\*Authentication Flow:\*\*\
> 1\. Client initiates connection with an Ethereum address\
> 2\. Server responds with a challenge string to sign\
> 3\. Client sends signed challenge with AuthChain\
> 4\. Server validates signature and assigns peer ID\
> \
> \*\*Supported Message Types:\*\*\
> \- \`challengeRequest\`: Initial connection with address\
> \- \`challengeResponse\`: Server-provided challenge\
> \- \`signedChallenge\`: Client-provided signed challenge with AuthChain\
> \- \`welcome\`: Server confirmation with assigned peer ID\
> \- \`heartbeat\`: Keep-alive messages\
> \- \`kicked\`: Disconnection notification\
> \
> Once authenticated, the peer receives real-time updates about island assignments, nearby peers, and position changes as they move through Decentraland's metaverse.<br>

```json
{"openapi":"3.1.0","info":{"title":"Archipelago Workers API","version":"1.0.0"},"servers":[{"url":"https://archipelago-ea-stats.decentraland.org","description":"Stats service - Production"},{"url":"https://archipelago-ea-stats.zone","description":"Stats service - Development"},{"url":"https://archipelago-ea-ws-connector.decentraland.org","description":"WebSocket Connector service - Production"},{"url":"https://archipelago-ea-ws-connector.zone","description":"WebSocket Connector service - Development"}],"security":[],"paths":{"/ws":{"get":{"tags":["WebSocket Connector Service"],"summary":"WebSocket connection","description":"Establishes a WebSocket connection for real-time communication in the Archipelago system. This endpoint enables peer-to-peer communication, position synchronization, and island management for Decentraland clients.\n\n**Authentication Flow:**\n1. Client initiates connection with an Ethereum address\n2. Server responds with a challenge string to sign\n3. Client sends signed challenge with AuthChain\n4. Server validates signature and assigns peer ID\n\n**Supported Message Types:**\n- `challengeRequest`: Initial connection with address\n- `challengeResponse`: Server-provided challenge\n- `signedChallenge`: Client-provided signed challenge with AuthChain\n- `welcome`: Server confirmation with assigned peer ID\n- `heartbeat`: Keep-alive messages\n- `kicked`: Disconnection notification\n\nOnce authenticated, the peer receives real-time updates about island assignments, nearby peers, and position changes as they move through Decentraland's metaverse.\n","operationId":"connectWebSocket","responses":{"101":{"description":"Switching protocols to WebSocket"},"200":{"description":"WebSocket connection established","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"code":{"type":"integer","description":"Error code"}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message"},"code":{"type":"integer","description":"Error code"}},"required":["error"]}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decentraland.org/apis/apis/archipelago-workers/web-socket-connector-service.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
