Coder Social home page Coder Social logo

pipesock's Introduction

Pipesock

A websocket server you can pipe to.

pipesockn'

Just a heads up: I'm still tweaking this a lot. If you have suggestions, problems please don't hesitate to open an issue.

To Install:

go get code.google.com/p/go.net/websocket
go get github.com/minikomi/pipesock
cd $GOPATH/src/github.com/minikomi/pipesock
go install

Then, provided you have $GOPATH/bin in your PATH you can start using the server with the pipesock command:

tail -f "some.log" | awk 'print{$2 "," $3}' | pipesock 

By default, you can then point your browser at localhost:9193.

Notes:

  • Other views can be added to $GOPATH/src/github.com/minikomi/pipesock/views/

  • Accessing /flush will clear the buffer.

  • The websocket can connect to /ws and receive serialized messages in the format:

    { Time: Timestamp for broadcast, Messages: [ { Time: Timestamp for readline, Message: Message string } .... ] }

  • The array of buffered messages can be read in JSON format at /buffer.json.

flags:

-d=2000: Delay between broadcasts of bundled events in ms (shorthand).
-delay=2000: Delay between broadcasts of bundled events in ms.
-l=false: Log HTTP requests tp STDOUT (shorthand).
-log=false: Log HTTP requetsts to STDOUT
-n=20: Number of previous broadcasts to keep in memory (shorthand).
-num=20: Number of previous broadcasts to keep in memory.
-p=9193: Port for the pipesock to sit on (shorthand).
-port=9193: Port for the pipesock to sit on.
-t=false: Pass output to STDOUT (shorthand).
-through=false: Pass output to STDOUT.
-v="default": View directory to serve (shorthand).
-view="default": View directory to serve.

Todo:

  • better d3 frontend
  • more views

pipesock's People

Contributors

minikomi avatar skratchdot avatar

Watchers

Christian Hochfilzer avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.