Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iassasin/wsproxy
simple websocket proxy to rest api using long polling
https://github.com/iassasin/wsproxy
Last synced: about 20 hours ago
JSON representation
simple websocket proxy to rest api using long polling
- Host: GitHub
- URL: https://github.com/iassasin/wsproxy
- Owner: iassasin
- Created: 2020-07-13T12:26:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T11:22:22.000Z (almost 2 years ago)
- Last Synced: 2023-02-26T15:36:41.502Z (over 1 year ago)
- Language: JavaScript
- Size: 677 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WebSocket proxy
This project proxies connection to configured websocket server via rest api and long polling.
## Usage
- `POST /open` - initiate connection to websocket server, returns json object, contained `connectionId`
- `GET /events?connectionId={id}` - get events as array of event objects. If there no events in connection, waits configured time interval in mills for events. If no events triggered, returns empty array. For example:
```
[
{type: 'message', data: 'hello, world from ws'},
{type: 'error', error: 'some message'}
]
```
- `POST /message?connectionId={id}` - send message to websocket server. Sends POST body as is.
- `POST /close?connectionId={id}` - closes the websocket connection## Config
See `./config.json`