HTML and CSS Reference
In-Depth Information
Listing 4.17. planner-server.js server code
Security and validation
In a real application, the server has additional responsibilities in terms of validating data
and persistence. A general tenet of server-side development is to never trust data you've
received over the wire. In order to concentrate on using WebSockets, those features have
been left out of the sample application in this section.
If you've followed along and either downloaded or re-created the UI logic, you should now
have a working planning-board application. In this model of web application development,
the server becomes another client. The bulk of the code involved is identical to what's run-
ning in all the users' browsers. You should also have the chat application from section 4.1
sitting in an iframe alongside it, but so far they're independent applications on different do-
mains. We assume you have the chat application on port 80 from a standard web server, and
the planning board is running on port 8080 from Node. Normally, the browser wouldn't al-
low scripts on either page to exchange data with each other. In the next section, you'll learn
about some HTML5 APIs that enable client-side communication between scripts from dif-
ferent domains.
Search WWH ::

Custom Search