Click here to Skip to main content
13,287,343 members (47,797 online)
Click here to Skip to main content


160 bookmarked
Posted 6 Feb 2010

Web Socket Server

, 3 Jun 2010
An example of an implementation of a web socket server and how to interact with it from JavaScript
This archive contains the compiled sources for the WebSocketServer (WebSocketServer.dll) and the WebSocketChatServer (WebSocketChatServer.exe).
Please rename WebSocketChatServer.exe_ to WebSocketChatServer.exe inorder to be able to execute it.

To interact with the server please use the following javascript on a web page running on localhost:8080

if('WebSocket' in window){
function connect(host) {
  var ws = new WebSocket(host);
  ws.onopen = function () {
  ws.onmessage = function (evt) {  
    alert('reveived data:';
  ws.onclose = function () {
    alert('socket closed');

See to read the full article and to download the source code

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Denmark Denmark
Software Developer in Aalborg, Denmark.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171207.1 | Last Updated 3 Jun 2010
Article Copyright 2010 by jonlist
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid