Search code examples
websocketmoovwebtritium

WebSocket connections and Tritium


Can a site use Tritium while also establishing open socket connections with whatever host you are 'filtering' requests from? Let's say I wanted to clone a site which is using WebSockets to keep open connections for a browser chat client. Would these requests be made directly between the browser and the remote host, or would they be passed through my Moovweb instance (which I'm presuming would allow me access to data in the stream)?


Solution

  • AFAIK, Moovweb 4.3 is not WebSocket aware. An upcoming release may support it though.

    WebSockets works cross-domain by default so it's easy to go direct to the origin WebSockets server.

    For example, say you specify the Websocket server with the line: var socket = new WebSocket("ws://echo.websocket.org");. You would not map the domain "echo.websocket.org" in Moovweb's config.json file. Instead you use the same line: var socket = new WebSocket("ws://echo.websocket.org"); on your Moovweb-powered site as well.