Skip to content

websocket

User65k edited this page Jan 16, 2024 · 2 revisions

MDN WebSockets API

There are different modes to utilize websockets with FRWS.

  1. Turn a websocket into a normal (TCP or Unix) socket. Somewhat like websockify
  2. Forward a websocket to another server as a Reverse Proxy

Config

Specify one of these subkey sets in a mount path.

Into Socket

An Application that binds on the socket will receive one connection per websocket.

key meaning
assock Socket to connect to, e.g. 127.0.0.1:1337 or ./myapp.sock
forward_header Optional Bool Indicates if HTTP headers are sent after a connection to the application
encoding Optional if set allows the usage of USVString in the websocket

Example

["example.com".ws] # /ws will be upgraded to a websocket
assock = "127.0.0.1:1337"

Clone this wiki locally