A PHP Error was encountered

Severity: Warning

Message: fopen(/tmp/ci_sessionqh9g49hebajbnfs4n2igplnkrmjdmebg): failed to open stream: No space left on device

Filename: drivers/Session_files_driver.php

Line Number: 174

Backtrace:

File: /var/www/socketsbay.com/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_start(): Failed to read session data: user (path: /tmp)

Filename: Session/Session.php

Line Number: 143

Backtrace:

File: /var/www/socketsbay.com/index.php
Line: 315
Function: require_once

WebSockets - πŸ‘©β€πŸ’» Do tests for FREE πŸ’ͺ - SocketsBay.com

Do a FREE Echo Test for Websockets

First, you can do a HTML5 WebSocket test against the echo server. You can also test against your own server URL.

Afterwards, you can see a walkthrough for creating a WebSocket application yourself. We host a WebSocket Echo Server at wss://socketsbay.com/wss/v2/1/demo/

Of course, you can also inspect WebSocket messages using your browser.

Go ahead and try it out!

Try our advanced WebSockets server, available for everyone

     
                                

Read a nice tutorial

Instructions

Do please note, that in some environments the WebSocket connection may fail due to intermediary firewalls, proxies, routers etc.

Creating your own test

Using a plaintext editor, copy the following code and save it as websocket.html. Afterwards, simply open it in a browser. The page will automatically connect, send a message, echo the response, and close the connection.

<!DOCTYPE html>
  
  <head>
    <title>WebSocket client test</title>
  </head>

  <body>
    <h1>WebSocket Client Test</h1>
    <div id="log"></div>
  </body>

<script language="javascript" type="text/javascript">

    var wsUri = "wss://socketsbay.com/wss/v2/2/demo/";
    var log;

    function init()
    {
      log = document.getElementById("log");
      testWebSocket();
    }

    function testWebSocket()
    {
      websocket = new WebSocket(wsUri);
      websocket.onopen    = function(evt) { onOpen(evt)    };
      websocket.onclose   = function(evt) { onClose(evt)   };
      websocket.onmessage = function(evt) { onMessage(evt) };
      websocket.onerror   = function(evt) { onError(evt)   };
    }

    function onOpen(evt)
    {
      writeLog("CONNECTED");
      sendMessage("Hello world");
    }

    function onClose(evt)
    {
      writeLog("Websocket DISCONNECTED");
    }

    function onMessage(evt)
    {
      writeLog('<span style="color: blue;">RESPONSE: ' + evt.data+'</span>');
      websocket.close();
    }

    function onError(evt)
    {
      writeLog('<span style="color: red;">ERROR:</span> ' + evt.data);
    }

    function sendMessage(message)
    {
      writeLog("SENT: " + message);
      websocket.send(message);
    }

    function writeLog(message)
    {
      var pre = document.createElement("p");
      pre.innerHTML = message;
      log.appendChild(pre);
    }

    window.addEventListener("load", init, false);

  </script>
  

If you continue to browse, we’ll use cookies that make our site work, improve performance, and customise your experience. If you accept, we’ll will not use cookies for ads.