Git Product home page Git Product logo

ws-tcp-proxy's Introduction

Websocket to TCP Proxy

This is a simple Websocket to TCP proxy, built on libuv.

Building

 	git clone [email protected]:FloydZ/ws-tcp-proxy
    cd ws-tcp-proxy
    mkdir build
	cd build
	cmake ..
	make -j1

Running

The server accepts the following arguments:

    ./ws-tcp-proxy --local 0.0.0.0:8080 --remote 127.0.0.1:5000

Features

  • supports parsing of all websocket control and data frames from a stream
  • evented io handled by libuv
  • does not support HTTP beyond what is required for performing a websocket handshake
  • builds on mac
  • at startup only consumes 600KB of RAM on linux
  • very small overhead per connection (need to measure)
  • handshake performed using joyent http-parser which is very low overhead and fast
  • only supports http://tools.ietf.org/html/rfc6455. It Is not backwards compatible
  • proxies websocket to a remote host/port
  • does not do any utf8 decoding for text frames. chunks of frame payloads are returned as pointers to char buffers whether they are binary or text

Future

  • support pausing of parser
  • plan to add SSL support
  • !!!!handle overflows on headers and header sizes!!!!
  • allow user definable limits on headers and header sizes
  • allow configuration of tcp backlog, nodelay, keepalive, connection limits, bandwidth throttling,
  • daemonization
  • websocket extension support
  • older websocket version support (include base64)
  • higher level api to deal with control frames and fragmented messages
  • possibly add support for static file serving and http user modules
  • tests
  • benchmarks
  • improve the make file to build and run tests
  • clean and small websocket api for servers and clients

Credits

This project is inspired/copied from ws-uv (https://github.com/billywhizz/ws-uv.git)

ws-tcp-proxy's People

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.