Archive for May, 2008

Writing p2p programs in javascript and html

Sunday, May 4th, 2008

Traditionally it has only been possible to create web-pages with the client-server model. This model is based upon the web browser connecting to a web server, requesting a web page and displaying the result. The last 3-4 years Ajax and web 2.0 has been all the rage, and has greatly improved how a web page can interact with the web server. With Ajax a web page can do async requests to a web server, and this makes it possible to construct programs out of a web page. A great example of this is Google Maps.


Using PeerAware it is now possible to create peer-to-peer web pages, or even combine the best from a client-server architecture with p2p. With PeerAware you run your own private p2p workspace, and all communication goes between connected members. The user-interface to the workspace is a web page with chat functionality, where all chat commands are sent across the p2p network to all connected members. It is the same communication path that can be used by customized web-pages. The owner of a PeerAware workspace decides what web-page should be loaded for members who connect to his workspace, and this web-page has a set of javascript functions available that can be used for communication between instances of the page.


To illustrate the concept a tutorial is available for those who want to use or make their own p2p javascript programs. I hope you enjoy this, it can be a lot of fun! If you have PeerAware installed you can also connect directly to the tutorial workspace.

Another example of this concept is the shared whiteboard that is part of the default workspace. This is a lot more advanced than the tutorial workspace, but if you are interested, the code is located in the html folder in the PeerAware program installation. This defaults to C:\Program Files\PeerAware in english language installations.

Posted in Uncategorized | No Comments »