mikedewar / post2ws

a simple CLI webserver that accepts a POST and publishes over a websocket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

post2ws

Runs an http server on :5000 that you can POST to. Every POST is broadcast on a websocket your client can connect to.

To post, curl localhost:5000 -d'what ho!'.

To connect to the websocket, in javscript

var ws = new WebSocket("ws://localhost:5000")
ws.onmessage = function(msg){console.log(msg)}

About

a simple CLI webserver that accepts a POST and publishes over a websocket


Languages

Language:Go 100.0%