forked from joewalnes/websocketd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jwalnes
committed
Nov 26, 2013
1 parent
b4aa0f6
commit 3a72ef8
Showing
8 changed files
with
135 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
This examples directory shows how websocketd can also serve CGI scripts via HTTP. | ||
|
||
$ websocketd --port=1234 --cgidir=examples/cgi-bin | ||
# Then access http://localhost:1234/dump-env.sh | ||
|
||
|
||
You can also test the command files by running from the command line. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2013 Joe Walnes and the websocketd team. | ||
# All rights reserved. | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file. | ||
|
||
# Standard CGI(ish) environment variables, as defined in | ||
# http://tools.ietf.org/html/rfc3875 | ||
NAMES=""" | ||
AUTH_TYPE | ||
CONTENT_LENGTH | ||
CONTENT_TYPE | ||
GATEWAY_INTERFACE | ||
PATH_INFO | ||
PATH_TRANSLATED | ||
QUERY_STRING | ||
REMOTE_ADDR | ||
REMOTE_HOST | ||
REMOTE_IDENT | ||
REMOTE_PORT | ||
REMOTE_USER | ||
REQUEST_METHOD | ||
REQUEST_URI | ||
SCRIPT_NAME | ||
SERVER_NAME | ||
SERVER_PORT | ||
SERVER_PROTOCOL | ||
SERVER_SOFTWARE | ||
UNIQUE_ID | ||
""" | ||
|
||
echo "Content-type: text/plain" | ||
echo | ||
|
||
for NAME in ${NAMES} | ||
do | ||
echo ${NAME}=${!NAME:-<unset>} | ||
done | ||
|
||
# Additional HTTP headers | ||
env | grep '^HTTP_' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters