Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't recommend any kind of input parsing in a shell script. You're better of having websocketd fork something like Python, Ruby, Perl, PHP, etc.

Like CGI, websocketd will pass additional URL path and query parameters as environment variables.

So you could access something like ws://somehost/?a=b and you'd access the QUERY_STRING environment variable in your script (which contains "a=b"). Virtually every scripting language already has a library for parsing CGI environment variables so you can do that.

Basically, websocketd tries to emulate CGI as much as possible, but provide WebSocket streams instead of HTTP responses.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: