Skip to content

torfuzx/websocket-utils

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Websocket utilities Is maintained?

Utilities for debug websocket (RFC4655) connections. These utilities will not dig deep and will not show you internals of the protocols (use Wireshark instead). But with them you just have simple way to establish connection with your websocket server and send test messages or connect to echo server for testing your client. Currently are:

  • wsclient — allows you to establish websocket connection with websocket server and send text messages from command line.
  • wsechoserver — just reply back messages it received from websocket client.

Install

Binary downloads Build Status

Prebuilt binaries provided for Linux x86_64:

Download and place them to $PATH.

Build from source

You need go environment then install external packages:

go get github.com/gorilla/websocket
go get github.com/kdar/factorlog
go get github.com/peterh/liner

For go 1.3 just use build -i for autoinstall external packages during build.

Makefile supplied to use make instead direct usage of go compiler.

make deps && make build && make install

Echo server

Just run it with -verb and/or -debug args. By default it listen on localhost:48084 but you may point it to another host:port with -listen parameter.

Client

After connect to websocket server client waits for input. Any input will send to remote server. Except two special cases:

  1. If you start text with ! followed by command(s) then external command(s) will executed and its output will send to a server:

    ! ls *.txt; date

  2. If you start text with < followed by filename then this file loads and its content send to server.

    < sample.json

Any other string sequences will send as is.

Try it for example as:

wsclient -bind=echo.websocket.org

About

Simple utils for testing websocket connections.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 94.8%
  • Makefile 5.2%