SockJS supports cross-domain communication. You can also isolate SockJS server and host it on a different domain than your main web site.
SockJS has the following goals:
- Simple browser-side and server-side APIs, as close to WebSocket API as possible.
- Well documented scaling and load balancing techniques.
- Transports must fully support cross-domain communication.
- Transports must fall back gracefully in case of restrictive proxies.
- Connection establishment should be fast.
- No Flash on the client side,
- Additionally the server side code should be simple, in order to lower the cost of writing servers for different languages.