Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lloydzhou/openresty-nchan
build nchan as openresty dynamic module
https://github.com/lloydzhou/openresty-nchan
Last synced: 7 days ago
JSON representation
build nchan as openresty dynamic module
- Host: GitHub
- URL: https://github.com/lloydzhou/openresty-nchan
- Owner: lloydzhou
- Created: 2021-11-30T01:02:08.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-25T09:09:35.000Z (10 months ago)
- Last Synced: 2024-12-27T05:25:23.945Z (22 days ago)
- Language: Dockerfile
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nchan
https://github.com/slact/nchan
Fast, horizontally scalable, multiprocess pub/sub queuing server and proxy for HTTP, long-polling, Websockets and EventSource (SSE), powered by Nginx.
# openresty
https://github.com/openresty/openresty
High Performance Web Platform Based on Nginx and LuaJIT
# nginx-proxy
https://github.com/nginx-proxy/nginx-proxy
Automated nginx proxy for Docker containers using docker-gen
# build
1. based on openresty/openresty:alpine
2. using multistage-build# Usage
```
docker run [options] lloydzhou/nchandocker run -v /my/custom/default.conf:/etc/nginx/conf.d/default.conf -p 80:80 lloydzhou/nchan
```
# test
## dependency
1. make
2. curl
3. wscat `sudo npm install -g wscat`## start server
```
make test
```
## client test### publish message using curl
```
curl --request POST --data "test message" -H "Accept: text/json" http://localhost:80/pub/test
{"messages": 2, "requested": 63, "subscribers": 0, "last_message_id": "1638248608:0" }
```
### subscribe message and publish message using wscat
```
wscat -c ws://localhost:80/pubsub/test
Connected (press CTRL+C to quit)
< test
< test message
> PING
< PONG
> test123
< test123
>```