ws

command module
v0.0.0-...-4c48c57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2015 License: BSD-2-Clause Imports: 7 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL