Skip to content

Commit

Permalink
Spelling and grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-gurban committed Dec 13, 2013
1 parent bc01d2f commit 82ab3fe
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
websocketd
==========

`websocketd` is a small command line tool that will wrap an existing command line interface program, and allow it to be accessed
via a WebSocket.
`websocketd` is a small command-line tool that will wrap an existing command-line interface program, and allow it to be accessed via a WebSocket.

WebSocket capable applications can now be built very easily. So long as you can write an executable program that reads `STDIN` and writes `STDOUT`, you
can build a WebSocket server. Do it in Python, Ruby, Perl, Bash, .NET, C, Go, PHP, Java, Clojure, Scala, Groovy, Expect, Awk, VBScript,
Haskell, Lua, R, whatever! No networking libraries necessary.
WebSocket-capable applications can now be built very easily. As long as you can write an executable program that reads `STDIN` and writes to `STDOUT`, you can build a WebSocket server. Do it in Python, Ruby, Perl, Bash, .NET, C, Go, PHP, Java, Clojure, Scala, Groovy, Expect, Awk, VBScript, Haskell, Lua, R, whatever! No networking libraries necessary.

Details
-------

Upon startup, `websocketd` will start a WebSocket server on the specified port, and listen for connections.
Upon startup, `websocketd` will start a WebSocket server on a specified port, and listen for connections.

Upon a connection, it will fork the appropriate process, and disconnect the process when the WebSocket connection closes (and vice-versa).

Any message sent from the WebSocket client will be piped to the process `STDIN` stream, followed by a `\n` newline.
Any message sent from the WebSocket client will be piped to the process's `STDIN` stream, followed by a `\n` newline.

Any text printed by the process to `STDOUT` shall be sent as a WebSocket message whenever a `\n` newline is encountered.

Expand All @@ -29,8 +26,7 @@ Download
Quickstart
----------

To get started, we'll create a WebSocket endpoint that will accept connections, then send back
messages, counting to 10 with 1 second pause between each one, before disconnecting.
To get started, we'll create a WebSocket endpoint that will accept connections, then send back messages, counting to 10 with 1 second pause between each one, before disconnecting.

To show how simple it is, let's do it in Bash!

Expand All @@ -44,8 +40,7 @@ for COUNT in $(seq 1 10); do
done
```

Before turning it into a WebSocket server, let's test it from the command line. The beauty of `websocketd` is servers
work equally well on the command line, or in shell scripts, as they do in the server - with no modifications required.
Before turning it into a WebSocket server, let's test it from the command line. The beauty of `websocketd` is that servers work equally well in the command line, or in shell scripts, as they do in the server - with no modifications required.

```sh
$ chmod +x count.sh
Expand Down

0 comments on commit 82ab3fe

Please sign in to comment.