All Projects → pingostack → nginx-websocket-module

pingostack / nginx-websocket-module

Licence: BSD-3-Clause license
nginx-websocket-module is based on nginx, you can use it to develop your own websocket server.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to nginx-websocket-module

Swoft Im
基于swoft-cloud的微服务架构,最小化拆分粒度,PHP7、多进程、协程、异步任务、mysql连接池、redi连接池、rpc连接池、服务治理、服务注册与发现、Aop切面、全注解
Stars: ✭ 189 (+1250%)
Mutual labels:  websocket-server
websocket-overlays
Websocket controlled Video Overlay server for OBS-Studio, XSplit, CasparCG, ProPresenter and everything with web browser.
Stars: ✭ 27 (+92.86%)
Mutual labels:  websocket-server
Lib.AspNetCore.WebSocketsCompression
[Archived] Lib.AspNetCore.WebSocketsCompression is a library which provides a managed implementation of the WebSocket protocol, along with server integration components and support for permessage-deflate compression.
Stars: ✭ 23 (+64.29%)
Mutual labels:  websocket-server
Ixwebsocket
websocket and http client and server library, coming with ws, a command line swiss army knife utility
Stars: ✭ 204 (+1357.14%)
Mutual labels:  websocket-server
Websocketd
Turn any program that uses STDIN/STDOUT into a WebSocket server. Like inetd, but for WebSockets.
Stars: ✭ 15,828 (+112957.14%)
Mutual labels:  websocket-server
rockgo
A developing game server framework,based on Entity Component System(ECS).
Stars: ✭ 617 (+4307.14%)
Mutual labels:  websocket-server
Libhv
🔥 比libevent、libuv更易用的国产网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket client/server.
Stars: ✭ 3,355 (+23864.29%)
Mutual labels:  websocket-server
WebSocketListener
A lightweight and highly scalable asynchronous WebSocket listener
Stars: ✭ 70 (+400%)
Mutual labels:  websocket-server
keker
Easy to use pub-sub message broker via websocket
Stars: ✭ 12 (-14.29%)
Mutual labels:  websocket-server
xray-heroku
No description or website provided.
Stars: ✭ 24 (+71.43%)
Mutual labels:  wss
Cwebsocket
cWebsocket is lightweight websocket server library
Stars: ✭ 241 (+1621.43%)
Mutual labels:  websocket-server
Mongols
C++ high performance networking with TCP/UDP/RESP/HTTP/WebSocket protocols
Stars: ✭ 250 (+1685.71%)
Mutual labels:  websocket-server
Server
The whir.io chat server.
Stars: ✭ 15 (+7.14%)
Mutual labels:  websocket-server
Fiery
A flexible and lightweight web server
Stars: ✭ 203 (+1350%)
Mutual labels:  websocket-server
teamtalk websocket server
让teamtalk支持websocket 从而实现web端的即时通讯
Stars: ✭ 14 (+0%)
Mutual labels:  websocket-server
Ws Tcp Relay
A simple relay between WebSocket clients and TCP servers
Stars: ✭ 186 (+1228.57%)
Mutual labels:  websocket-server
lucee-websocket
Enables server WebSockets for Lucee via JSR-356 compliant servlet containers (e.g. Tomcat 8, Jetty 9.1, etc.)
Stars: ✭ 16 (+14.29%)
Mutual labels:  websocket-server
racket-rfc6455
RFC 6455 WebSockets support for Racket.
Stars: ✭ 32 (+128.57%)
Mutual labels:  websocket-server
Rockets
REST and websockets C++ library
Stars: ✭ 39 (+178.57%)
Mutual labels:  websocket-server
mem usage ui
Measuring and graphing memory usage of local processes
Stars: ✭ 124 (+785.71%)
Mutual labels:  websocket-server

NGINX-based Websocket Server

nginx-websocket-module

Project blog

http://pingos.io/

  • wss client client-wss

  • nginx-websocket-module supports wss protocol nginx-wss

Code sample

If you want to know how to develop a websocket server, refer to the code in the 't/ngx_websocket_echo_module.c' .

Build

$
$ git clone https://github.com/nginx/nginx.git
$
$ git clone https://github.com/im-pingo/nginx-websocket-module.git
$
$ cd nginx
$
$ ./auto/configure --add-module=../nginx-websocket-module --add-module=../nginx-websocket-module/t
$
$ sudo make && sudo make install
$

Config file

websocket

  • syntax : websocket [any]

  • context: location

The switch of websocket service has no args

websocket out_queue=[num] message_length=[num] ping_interval=[time] timeout=[time];

options

out_queue
  • syntax: out_queue=[num] (default 512)
  • context: websocket's arg

Number of out queue

message_length
  • syntax: message_length=[num] (default 4096000 bytes)
  • context: websocket's arg

Max length of websocket message

ping_interval
  • syntax: ping_interval=[msec] (default 5000ms)
  • context: websocket's arg

Time interval between pings

timeout
  • syntax: timeout=[msec] (default 15000ms)
  • context: websocket's arg

receive timeout

websocket_echo

  • syntax: websocket_echo [no args]
  • context: location

The server responses the data it received

websocket_echo;

Example nginx.conf

daemon on;
master_process on;
#user  nobody;
worker_processes  1;

error_log  logs/error.log  info;

pid        logs/nginx.pid;
events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;

        # use wss(ssl)
        listen       443 ssl;
        ssl_certificate /usr/local/nginx/key/im-pingo.crt;
        ssl_certificate_key /usr/local/nginx/key/im-pingo.key;

        server_name  localhost;

        location /im-pingo {
            websocket out_queue=512 message_length=4096000 ping_interval=5000ms timeout=15s;
            websocket_echo;
        }
    }
}
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].