A simple proxy that forwards Websocket messages to Unix sockets and vice versa.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore Initial release - version 0.1.0 Dec 20, 2018
Cargo.lock Initial release - version 0.1.0 Dec 20, 2018
Cargo.toml Initial release - version 0.1.0 Dec 20, 2018
README.md Initial release - version 0.1.0 Dec 20, 2018
build.rs Initial release - version 0.1.0 Dec 20, 2018
config_spec.toml Initial release - version 0.1.0 Dec 20, 2018

README.md

Websocket - Unix framed bridge

A simple proxy that forwards Websocket messages to Unix sockets and vice versa.

About

This is a very simple proxy between Websockets and Unix domain sockets. It acts as a Websocket server while forwarding all messages to a specified Unix socket.

The messages forwarded to Unix socket are length-delimited, where length of each message is encoded as 32-bit native-endian binary number. The length is prepended to each message forwarded to Unix socket.

Conversely, each message coming from Unix socket is decoded as 32-bit native-endian length followed by the payload. It is attempted to interpret the message as utf-8 string and send it over websocket as text message. However, if the conversion fails, the message is sent as binary.

Usage

This program is written in Rust. Compile it using cargo build --release. You'll find the binary in target/release/ there's also a man page generated in target/

In order to run use: ws-unix-framed-bridge --socket-path=SOCKET\_PATH --bind-addr=BIND\_ADDR

Alternatively you may provide the arguments in toml file named ws-unix-bridge.conf located in CWD.

License

MITNFA