dev:websockets:gateway:websocketd
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| dev:websockets:gateway:websocketd [2018/06/14 15:56] – [Optional Systemd Setup] erickson | dev:websockets:gateway:websocketd [2022/02/10 13:34] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 46: | Line 46: | ||
| </ | </ | ||
| - | ==== Run Websocketd on port 7684 ==== | + | ==== Run Websocketd on port 7682 ==== |
| < | < | ||
| + | # Stop apache-websockets first since we're reusing the port. | ||
| + | sudo systemctl stop apache2-websockets # or similar | ||
| + | |||
| # AS USER opensrf | # AS USER opensrf | ||
| - | / | + | / |
| # Or optionally override the config file path | # Or optionally override the config file path | ||
| - | / | + | / |
| # Optionally background the process with a trailing '&' | # Optionally background the process with a trailing '&' | ||
| </ | </ | ||
| + | Full set of command line args at https:// | ||
| ==== Modify NGINX to proxy websocketd ==== | ==== Modify NGINX to proxy websocketd ==== | ||
| Line 64: | Line 68: | ||
| < | < | ||
| - | # comment out the apache-websocket proxy. | + | # Websocketd supports SSL, but I run it in non-SSL mode since it's on the same machine as NGINX. |
| - | # proxy_pass | + | # Replace |
| + | proxy_pass http:// | ||
| - | # I run websocketd in non-SSL (http://) mode behind | + | # Update timeout values within |
| - | proxy_pass http:// | + | # to disconnect idle clients. |
| - | + | ||
| - | # Update timeout values | + | |
| # The osrf-websocket-stdio handler has no idle timeout threads. | # The osrf-websocket-stdio handler has no idle timeout threads. | ||
| # Change to suit | # Change to suit | ||
| Line 124: | Line 127: | ||
| Environment=PATH=/ | Environment=PATH=/ | ||
| Environment=LD_LIBRARY_PATH=/ | Environment=LD_LIBRARY_PATH=/ | ||
| - | ExecStart=/ | + | ExecStart=/ |
| - | # --sameorigin and --origin=domain1, | + | # modify websocketd command line options to taste |
| + | # --sameorigin and --origin=domain1, | ||
| + | # On Ubuntu 18.04, you may also need to include something like this: | ||
| [Install] | [Install] | ||
| WantedBy=multi-user.target | WantedBy=multi-user.target | ||
| Line 135: | Line 140: | ||
| < | < | ||
| - | $ sudo systemctl daemon-reload | + | # disable apache2-websockets to avoid unintended starts & port conflicts |
| - | $ sudo systemctl enable websocketd-osrf | + | sudo systemctl disable apache2-websockets |
| - | $ sudo systemctl start websocketd-osrf | + | |
| + | # enable and start websocketd-osrf | ||
| + | sudo systemctl daemon-reload | ||
| + | sudo systemctl enable websocketd-osrf | ||
| + | sudo systemctl start websocketd-osrf | ||
| </ | </ | ||
dev/websockets/gateway/websocketd.1529006219.txt.gz · Last modified: 2022/02/10 13:34 (external edit)