DEV Community

Santhosh Kumar
Santhosh Kumar

Posted on

Websocket

With webSockets you have a stateful request /response system, how can we store websocket connection reference in the server such that we can have stateless system ?

Top comments (2)

Collapse
 
rhymes profile image
rhymes

You might need a reverse proxy like

fanout / pushpin

Reverse proxy for realtime web services

Pushpin

Website: pushpin.org/
Mailing List: lists.fanout.io/mailman/listinfo/f...
Chat Room: Join the chat at https://gitter.im/fanout/pushpin

Pushpin is a reverse proxy server written in C++ that makes it easy to implement WebSocket, HTTP streaming, and HTTP long-polling services. The project is unique among realtime push solutions in that it is designed to address the needs of API creators. Pushpin is transparent to clients and integrates easily into an API stack.

How it works

Pushpin is placed in the network path between the backend and any clients:

pushpin-abstract

Pushpin communicates with backend web applications using regular, short-lived HTTP requests. This allows backend applications to be written in any language and use any webserver. There are two main integration points:

  1. The backend must handle proxied requests. For HTTP, each incoming request is proxied to the backend. For WebSockets, the activity of each connection is translated into a series of HTTP requests1 sent to the backend. Pushpin's behavior is determined by…


or you could use HTTP/2 to do bidirectional communication and skip WebSockets.

Collapse
 
5anthosh profile image
Santhosh Kumar

Thanks 😀