Configuring WebSocket

WebSocket is a protocol that allows bi-directional web communication between client and server.

Cloud 66 configuration for WebSocket

Cloud 66 opens 8080 and 8443 ports by default on your servers to allow you to use WebSocket.

If you want to use WebSocket with Cloud 66, your WebSocket servers need to listen to the following ports:

You can use a different port to use WebSocket (not supported by Cloud 66) but you will need manually open the ports to allow external connections to your servers.

Find out more about service networking.

WebSocket through a load balancer

You can use a load balancer and scale up your servers to have more redundancy and capacity for your WebSocket servers.


ELB (Amazon) doesn’t support WebSocket traffic.

Learn more about Cloud 66 HAProxy and WebSocket setup.

On Linode alternative HTTP ports 8080 and 8443 are opened on NodeBalancers and can be used for WebSockets.

Test your WebSocket server

To test your WebSocket server, create a .html file with the code below, make sure to replace <your_address> with your WebSocket server IP address and finally, open it in a web browser.

    <script src=""></script>
        function debug( str ) {
          $("#debug").append( str );

        ws = new WebSocket("ws://your address");
        ws.onmessage = function(evt) {
        ws.onclose = function() {
          debug("socket closed");
        ws.onopen = function() {
          ws.send("hello server");
    <div id="debug"></div>
    <div id="msg"></div>