Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Mind the line that builds the Url for the websocket initialize request. It is a url that starts with ws:// and then just the regular url of this particular page.  

...

When the browser starts the websocket, a single GET request will be issued to the IndexPage. This GET request will contain extra HTTP headers which will be caught by the code that is embedded into the IndexPage. That code will upgrade the regular webserver-connection to a websocket-connection.

Note: The browser will not receive any data or html automatically. You will have to explicitly send data to the connected client(s). You can easily send data to a newly connected client by embedding code in the WebsocketsHandler as explained later in this article.

DispatchForm procedure

The DispatchForm procedure contains the form to add a new ride. This form is not linked to a table and does not have a regular save button.The 'Save ride' button instead is a button with only a single line of Javascript attached to the onclick event.

...