example script for websocketd that enable running interactive commands for a cloud foundry application using a browser and websocket. websocketd with the devconsole option can easily send text commands from the browser (such as rake db:migrate
) to STDIN of the bash.sh
script which executes the commands and returns STDOUT as lines to the browser.
- downlaod a linux 64bit version of websocketd and place it in this directory
- execute
chmod +x websocketd
- copy the entire
websocketd-cloudfoundry
into the app dir you would like to use it with - push the application using something like
gcf push myapp -c '/app/websocketd-cloudfoundry/websocketd --port=$PORT --dir=/app/websocketd-cloudfoundry --devconsole
- visit the URL of the application with /bash.sh at the end
- make sure that URL next to the checkbox uses the right protocol (either ws or wss) and a port that supports that protocol. on run.pivotal.io that will be a URL like wss://websocketd.cfapps.io:4443/bash.sh
- type some commands such as
pwd
orls -al
orps aux
for more detail this video or the blog post.