2.0.8 • Published 6 years ago

servep v2.0.8

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago
This script serves stdio executables over TCP, HTTP, or WebSockets.
[Bug fixes and features requests: https://github.com/vdv7/servep/issues]

Each new TCP or WS connection to server will spawn a new process, and pipe
socket-out to std-in, and std-out to socket-in.

HTTP requests without a session-id are redirected, so as to include unique
session-id. Each new session-id is tied to a newly spawned process. Data in
each HTTP request with a session-id is routed to its respective process 
std-in, and the HTTP response is generated from that process' std-out.

  HTTP requests adhere to the CDE (callback/data/end) protocol, i.e.:

    JSONP requests are enabled by adding GET parameter "callback" or GET
      parameter "c"
    all input to server-side process is passed in POST method body, or
      as the value for GET parameter "data" or GET parameter "d"
    adding GET parameter "end" or GET parameter "e" to an HTTP request
      gracefully ends the current session

    example of simple echo process interaction:

      client GET request:
        http://localhost:8000/myapp
      server responds with a status code of 302 and the following body:
        http://localhost:8000/myapp:xxx
          (where xxx is the session id)
      client GET request:
        http://localhost:8000/myapp:xxx?d=hello
      server response body:
        foo("you said: hello")
      client GET request: http://localhost:8000/myapp:xxx?e
      server closes the running echo process and responds with status 204


Examples:
  servep -p 8000 --http "hi::echo hi" --ws "hi::echo hi" --tcp "8001::echo hi"
  (will serve process "echo hi" at http://localhost:8000/hi, 
    ws://localhost:8000/hi, and on tcp without any headers on port 8001)

  servep -p 8000 --http samples/_http/ --py python3
  (will serve all executables from samples/_http folder, as well as any
    python3 scripts that have a .py extension. if samples/_http includes
    helloecho.py, it will be served at http://localhost:8000/helloecho.py)



Using this script requires that you have node.js installed
  (see https://nodejs.org)

Try out the service on the sample scripts folder:
  node servep.js samples/

Install script via npm: npm install -g servep
  (you may need to precede the previous line with "sudo" on linux)

Run after npm installation:
  servep [Options]

Get usage:
  servep

Get more detailed help:
  servep --help
2.0.8

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago