Skip to content

Connect to websocket.org echo service #533

Closed
@fajarmf

Description

@fajarmf

Hi,
I want to use socket io client that can work with the echo service of http://websocket.org/echo.html (ws://echo.websocket.org). However I tried creating the following code:

<script src="/socket.io/socket.io.js"></script>
<script>
  var socket = io.connect('ws://echo.websocket.org');
  console.log('done connect');
  socket.on('connect', function (data) {
    socket.send('hi from me');
  });
  console.log('done setup');
</script>

But I cannot seems to make it works, i.e. I didn't get the echo from the server.

Thanks in advance,

Idos

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions