jack1582 / ws

A WebSocket cli tool.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WS

A WebSocket command line tool (mostly for testing).

Type to stdin to send along the WebSocket. WebSocket responses will be printed to stdout.

Install

If you have Go installed just run:

go get github.com/yhat/ws

If you're on OS X use brew to install (no go required).

brew install https://raw.githubusercontent.com/yhat/ws/master/ws.rb

Otherwise direct downloads are available through the releases page.

Usage

Given an example server.

var WebSocketServer = require('ws').Server
  , wss = new WebSocketServer({port: 5000});
wss.on('connection', function(ws) {
  ws.on('message', function(message) {
    ws.send(message)
    ws.send("OVER")
  });
});

Let's make sure it's working with ws.

$ ws ws://127.0.0.1:5000/
That's a mighty fine websocket cli tool you've got there
That's a mighty fine websocket cli tool you've got there
OVER

About

A WebSocket cli tool.

License:BSD 2-Clause "Simplified" License


Languages

Language:Go 54.7%Language:Python 37.5%Language:Ruby 7.8%