> For the complete documentation index, see [llms.txt](https://docs.novel.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.novel.dev/novel-server/sockets.md).

# Sockets

{% hint style="warning" %}
This article is still under construction
{% endhint %}

In the client, you can use&#x20;

```
const socket = useSocket(namespace);

socket.on('event', () => null);
socket.emit('event', 'toServer');
```

in the server, you can create a route handler in the api directory

```
export default function Route (instance) {
    instance.socket('namespace', {}, handler);
    
    async function handler(socket) {
        socket.on('event', () => null);
    }
}
```
