# Connecting

<table data-header-hidden><thead><tr><th width="214.1904761904762">Endpoint</th><th>Description</th></tr></thead><tbody><tr><td><strong>Environment</strong></td><td><strong>Endpoint</strong></td></tr><tr><td>Production</td><td><code>wss://ws.sfox.com/ws</code></td></tr><tr><td>Staging</td><td><code>wss://ws.staging.sfox.com/ws</code></td></tr></tbody></table>

{% tabs %}
{% tab title="NodeJS" %}

```javascript
const WebSocket = require('ws');

const ws = new WebSocket('wss://ws.sfox.com/ws');

// don't forget to subscribe (see below)
ws.on('message', function(data) {
    // Do something with data
    console.log(data);
});
```

{% endtab %}

{% tab title="Python" %}

```python
import asyncio

import websockets

async def main(uri):
    async with websockets.connect(uri) as ws:
        # don't forget to subscribe (see below)
        async for msg in ws:
            print(msg)


asyncio.run(main("wss://ws.sfox.com/ws"))
```

{% endtab %}
{% endtabs %}
