Modifying the browser view
One last thing we need to do is go to the index.ejs
file and change some things there. Using the same index.ejs
as from the previous chapter, we’re going to change the opponent field with a field that will let us indicate which server we wish to connect to – in other words, the component JID of the XMPPong game.
The way this would work in reality is that a client would use DISCO
to discover the capabilities of the server. If the response indicated that there was an XMPPong capability available on the server, this would be made available to the client – provided that the client understands how to play Pong, of course!
In index.ejs
, simply change the phrase Opponent JID
to Component JID
, and change the id of opponent
to componentJid
.