Differences
This shows you the differences between two versions of the page.
Both sides previous revision
Previous revision
|
Next revision
Both sides next revision
|
blocks:app-note:google-web-designer [2023-08-09 12:55] melvin Add WebSocket URL description |
blocks:app-note:google-web-designer [2023-08-09 13:06] melvin Improve WebSocket URL description |
| |
When using the "Preview" functionality in Google Web Designer, or if the final result is not going to be served by the Blocks server, the WebSocket URL to the Blocks server must be specified. Open the "Code view" and add the following lines at the top of the main HTML file, under the "<head>" tag: | When using the "Preview" functionality in Google Web Designer, or if the final result is not going to be served by the Blocks server, the WebSocket URL to the Blocks server must be specified. Open the "Code view" and add the following lines at the top of the main HTML file, under the "<head>" tag: |
| |
<code> | <code> |
<script type="text/javascript"> | <script type="text/javascript"> |
var BLOCKS_WEBSOCKET_URL = "ws://10.0.1.209:8080/rpc/pub-sub"; | var BLOCKS_WEBSOCKET_URL = "ws://<nameOrIp><:nonStandardPort>/rpc/pub-sub"; |
</script> | </script> |
</code> | </code> |
| Replace <nameOrIp> with the IP number or resolvable name to your Blocks server. If you're using HTTPS to access your Blocks server, specify "wss:" as the protocol instead of "ws:". If you're running on a non-standard port, append the port number separated by a colon. |
Replace the IP address and the port with the IP address and port of your Blocks server. The port number (including the colon) is only necessary if you are running Blocks under a non-standard port. | |
| |
==== Example: Run a Task by clicking a button ==== | ==== Example: Run a Task by clicking a button ==== |