For now there are two methods: - `NETWORK:IsUrlAllowed()`: Check whether access to a certain URL is allowed. - `NETWORK:HttpRequest()`: Perform an HTTP request. By default access to the network is disabled for all target hosts. It can be enabled by setting `HttpEnable=1` in the preferences. Individual hosts have to be added to `HttpAllowHosts` as a comma separated list to allow access. See included docs for more details on usage.
26 lines
479 B
Bash
26 lines
479 B
Bash
#!/bin/sh
|
|
|
|
# Handle Ctrl-C by killing all sub-processing AND exiting
|
|
trap cleanup INT
|
|
|
|
function cleanup {
|
|
kill `cat /tmp/pidfile.subscribe`
|
|
exit 1
|
|
}
|
|
|
|
REDIS_HOST=${REDIS_HOST:=localhost}
|
|
|
|
ws redis_subscribe --pidfile /tmp/pidfile.subscribe --host $REDIS_HOST foo &
|
|
|
|
# Wait for the subscriber to be ready
|
|
sleep 0.5
|
|
|
|
# Now publish messages
|
|
ws redis_publish -c 100000 --host ${REDIS_HOST} foo bar
|
|
|
|
# Wait a little for all messages to be received
|
|
sleep 1.5
|
|
|
|
# Cleanup
|
|
cleanup
|