websocket.md (1672B)
1 # WebSocket 2 3 GoToSocial uses the secure [WebSocket protocol](https://en.wikipedia.org/wiki/WebSocket) (aka `wss`) to allow for streaming updates of statuses and notifications via client apps like Semaphore. 4 5 In order to use this functionality, you need to ensure that whatever proxy you've configured GoToSocial to run behind allows WebSocket connections through. 6 7 The WebSocket endpoint is located at `wss://example.org/api/v1/streaming` where `example.org` is the hostname of your GoToSocial instance. 8 9 The WebSocket endpoint uses the same port as configured in the `port` section of your [general config](../../configuration/general.md). 10 11 Typical WebSocket **request** headers as sent by Pinafore look like the following: 12 13 ```text 14 Host: example.org 15 User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0 16 Accept: */* 17 Accept-Language: en-US,en;q=0.5 18 Accept-Encoding: gzip, deflate, br 19 Sec-WebSocket-Version: 13 20 Origin: https://pinafore.social 21 Sec-WebSocket-Protocol: null 22 Sec-WebSocket-Extensions: permessage-deflate 23 Sec-WebSocket-Key: YWFhYWFhYm9vYmllcwo= 24 DNT: 1 25 Connection: keep-alive, Upgrade 26 Sec-Fetch-Dest: websocket 27 Sec-Fetch-Mode: websocket 28 Sec-Fetch-Site: cross-site 29 Pragma: no-cache 30 Cache-Control: no-cache 31 Upgrade: websocket 32 ``` 33 34 Typical WebSocket **response** headers as returned by GoToSocial look like the following: 35 36 ```text 37 HTTP/1.1 101 Switching Protocols 38 Upgrade: websocket 39 Connection: Upgrade 40 Sec-WebSocket-Accept: WVdGaFlXRmhZbTl2WW1sbGN3bz0K 41 ``` 42 43 Whatever your setup, you need to ensure that these headers are allowed through your proxy, which may require extra configuration depending on the exact proxy being used.