Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/narasimha1997/socketio-cgi
A cgi layer that allows any process / program to stream data across world wide web.
https://github.com/narasimha1997/socketio-cgi
Last synced: 6 days ago
JSON representation
A cgi layer that allows any process / program to stream data across world wide web.
- Host: GitHub
- URL: https://github.com/narasimha1997/socketio-cgi
- Owner: Narasimha1997
- Created: 2019-11-08T16:06:35.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-08T16:23:19.000Z (about 5 years ago)
- Last Synced: 2023-03-04T03:59:09.429Z (over 1 year ago)
- Language: Go
- Size: 6.84 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# socketio-cgi
A cgi layer that allows any process / program to stream data across world wide web.### How it works ?
The core idea behind this project is to use POSIX Pipes to grab `stdout` from a child process and streaming them over a socket.io interface.
Clients can connect to the server using socket.io client and grab the streamed outputs.### Endpoints:
`/probe/` - Main socket.io route
`/probe/ event name = stdout message = any` - Make a ping to /probe/ with stdout as event to start streaming.
`event listner = probes` = All the stdout data is streamed using this event.### How to compile ?
To compile the program, provide +x permission to `build.sh`. Now run :
`./build.sh or $sh build.sh`### How to run a program with socketio-cgi support ?
Run the program inside socketio-cgi following command :
`./build_object program_file [...args]`For example : Run sample test.sh program
`./build_object sh test.sh`If you encounter any issues while running along with python program, its because of the output buffering of the python interpteter.
Disable buffering or call `sys.stdout.flush()` to manually flush the buffer. One best solution is to use `print()` as it automatically
clears the buffer.#### This is the initial version and might have bugs. More functionalities and bugs will be fixed later.