All Projects → allinurl → Gwsocket

allinurl / Gwsocket

Licence: mit
fast, standalone, language-agnostic WebSocket server RFC6455 compliant

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Gwsocket

text
An experiment with WebSockets and the human condition.
Stars: ✭ 51 (-90.73%)
Mutual labels:  websocket-server, websockets
Rockgo
A developing game server framework,based on Entity Component System(ECS).
Stars: ✭ 532 (-3.27%)
Mutual labels:  websockets, websocket-server
node-jsonrpc2
JSON-RPC 2.0 server and client library, with HTTP (with Websocket support) and TCP endpoints
Stars: ✭ 103 (-81.27%)
Mutual labels:  websocket-server, websockets
remoting
Jetlang Remoting - asynchronous distributed messaging
Stars: ✭ 27 (-95.09%)
Mutual labels:  websocket-server, websockets
Php Websocket
Simple WebSocket server implemented in PHP.
Stars: ✭ 473 (-14%)
Mutual labels:  websockets, websocket-server
simple-websocket-server
A simple WebSocket server
Stars: ✭ 26 (-95.27%)
Mutual labels:  websocket-server, websockets
LazWebsockets
Websocket Server and Client Library written in Lazarus
Stars: ✭ 51 (-90.73%)
Mutual labels:  websocket-server, websockets
Ixwebsocket
websocket and http client and server library, coming with ws, a command line swiss army knife utility
Stars: ✭ 204 (-62.91%)
Mutual labels:  websockets, websocket-server
Seasocks
Simple, small, C++ embeddable webserver with WebSockets support
Stars: ✭ 517 (-6%)
Mutual labels:  websockets, websocket-server
Microwebsrv2
The last Micro Web Server for IoTs (MicroPython) or large servers (CPython), that supports WebSockets, routes, template engine and with really optimized architecture (mem allocations, async I/Os). Ready for ESP32, STM32 on Pyboard, Pycom's chipsets (WiPy, LoPy, ...). Robust, efficient and documented!
Stars: ✭ 295 (-46.36%)
Mutual labels:  websockets, websocket-server
channeled-dashboard
Repository for the talk `Building real time applications with Django and Channels`
Stars: ✭ 20 (-96.36%)
Mutual labels:  websocket-server, websockets
Atmosphere
Realtime Client Server Framework for the JVM, supporting WebSockets with Cross-Browser Fallbacks
Stars: ✭ 3,552 (+545.82%)
Mutual labels:  websockets, websocket-server
Websocketd
Turn any program that uses STDIN/STDOUT into a WebSocket server. Like inetd, but for WebSockets.
Stars: ✭ 15,828 (+2777.82%)
Mutual labels:  websockets, websocket-server
apollo-chat-graphql-server
Apollo Chat is a Chat Service build on GraphQL Apollo with Subscriptions
Stars: ✭ 13 (-97.64%)
Mutual labels:  websocket-server, websockets
Websocat
Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
Stars: ✭ 3,477 (+532.18%)
Mutual labels:  websockets, websocket-server
reactive-streams-for-java-developers
No description or website provided.
Stars: ✭ 16 (-97.09%)
Mutual labels:  websocket-server, websockets
Websocket
WSServer is a fast, configurable, and extendable WebSocket Server for UNIX systems written in C (C11).
Stars: ✭ 144 (-73.82%)
Mutual labels:  websockets, websocket-server
Ws Tcp Relay
A simple relay between WebSocket clients and TCP servers
Stars: ✭ 186 (-66.18%)
Mutual labels:  websockets, websocket-server
Beast
HTTP and WebSocket built on Boost.Asio in C++11
Stars: ✭ 3,241 (+489.27%)
Mutual labels:  websockets, websocket-server
Websockets
Library for building WebSocket servers and clients in Python
Stars: ✭ 3,724 (+577.09%)
Mutual labels:  websockets, websocket-server

gwsocket Build Status gwsocket

What is it?

gwsocket is a simple, standalone, language-agnostic, RFC6455 compliant WebSocket Server, written in C. It sits between your application and the client's browser, giving fast bidirectional communication between these two with ease and flexibility. More info at: http://gwsocket.io.

gwsocket terminal

How it Works?

Very simple, just redirect the output from your application (stdout) to stdin or to file (named pipe) and let gwsocket transfer the data to the browser — That's it.

For example, tailing your server's logs into the browser couldn't be easier

# tail -f /var/log/nginx/access.log > /tmp/wspipein.fifo

OR

# tail -f /var/log/nginx/access.log | gwsocket

You can also get the client's data into (stdin) your application. In fact, you can even send your favorite ncurses program's output to the browser. See screencast above.

Features

  • Message Fragmentation per section 5.4
  • UTF-8 Handling
  • Framing (Text & Binary messages)
  • Multiplexed non-blocking network I/O
  • Ability to pipe data in/out in two different modes (stdin/stdout & strict mode)
  • Origin-based restriction
  • It passes the Autobahn Testsuite :)
  • and of course, Valgrind tested
  • missing something?, please feel free to post it on Github.

Why gwsocket?

I needed a fast, simple, no-dependencies, no libraries, RFC6455 compliant WebSocket Server written in C that I could use for version 1.0 of GoAccess by simply piping data in and out — WebSockets made easy!

More Examples?

gwsocket is language agnostic, look at the Man Page for more details and examples on how to receive data from the browser and how to send it to the browser.

Installation

Installing gwsocket is pretty easy. Just download, extract and compile it with:

$ wget http://tar.gwsocket.io/gwsocket-0.3.tar.gz
$ tar -xzvf gwsocket-0.3.tar.gz
$ cd gwsocket-0.3/
$ ./configure
$ make
# make install

No dependencies needed. How nice isn't it :), well almost, you need gcc, make, etc.

Build from GitHub

$ git clone https://github.com/allinurl/gwsocket.git
$ cd gwsocket
$ autoreconf -fiv
$ ./configure
$ make
# make install

Data Modes

In order to establish a channel between your application and the client's browser, gwsocket provides two methods that allow the user to send data in and out. The first one is through the use of the standard input (stdin), and the standard output (stdout). The second method is through a fixed-size header followed by the payload. See options below for more details.

STDIN/STDOUT

The standard input/output is the simplest way of sending/receiving data to/from a client. However, it's limited to broadcasting messages to all clients. To send messages to or receive from a specific client, use the strict mode in the next section. See language specific examples here.

Strict Mode

gwsocket implements its own tiny protocol for sending/receiving data. In contrast to the stdin/stdout mode, the strict mode allows you to send/receive data to/from specific connected clients as well as to keep track of who opened/closed a WebSocket connection. It also gives you the ability to pack and send as much data as you would like on a single message. See language specific examples here.

Command Line / Config Options

The following options can be supplied to the command line.

Command Line Option Description
-p --port Specifies the port to bind.
-h --help Command line help.
-V --version Display version information and exit.
--access-log=<path/file> Specifies the path/file for the access log.
--addr=<addr> Specifies the address to bind.
--echo-mode Set the server to echo all received messages.
--max-frame-size=<bytes> Maximum size of a websocket frame.
--origin=<origin> Ensure clients send the specified origin header upon handshake.
--pipein=<path/file> Creates a named pipe (FIFO) that reads from on the given path/file.
--pipeout=<path/file> Creates a named pipe (FIFO) that writes to the given path/file.
--strict Parse messages using strict mode. See man page for more details.
--ssl-cert=<cert.crt> Path to SSL certificate.
--ssl-key=<priv.key> Path to SSL private key.

Roadmap

  • Support for epoll and kqueue
  • Add more command line options
  • Add configuration file
  • Please feel free to open an issue to discuss a new feature.

License

MIT Licensed

Contributing

Any help on gwsocket is welcome. The most helpful way is to try it out and give feedback. Feel free to use the Github issue tracker and pull requests to discuss and submit code changes.

Enjoy!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].