function WebSocketTest() {
    if ("WebSocket" in window) {
        // Open a Web Socket
        var ws = new WebSocket("ws://banl07r9ameaf/HTML5Demo/");
        ws.onopen = function () {
            // Send data
            ws.send("Message sent to server");
            alert("Message was sent to server.");
        };
        ws.onmessage = function (evt) {
            //Recieve data
            var receivedmsg = evt.data;
            alert("Message is received from server"+ receivedmsg);
        };
        ws.onclose = function () {
            // Close a Websocket
            alert("Connection is closed.");
        };
        ws.onerror = function (evt) {
            // Log Error
            alert("ERROR!!! " + evt.message);
        };
    }
}
/*
Learned from web:
The WebSocket features in .NET 4.5 and IIS 8 (including Express) require Windows 8 
because they use a native Windows component (websocket.dll) that is new to Windows 8.

Once you are running on Windows 8, you can turn on the IIS WebSocket module under 
"Turn Windows features on or off" -> Internet Information Services ->World Wide Web Services 
-> Application Development Features -> WebSocket Protocol 
*/
Learned from web:
The WebSocket features in .NET 4.5 and IIS 8 (including Express) require Windows 8
because they use a native Windows component (websocket.dll) that is new to Windows 8.

Once you are running on Windows 8, you can turn on the IIS WebSocket module under
"Turn Windows features on or off" -> Internet Information Services ->World Wide Web Services
> Application Development Features -> WebSocket Protocol
Learned from web : The WebSocket features in . NET 4 . 5 and IIS 8 ( including Express ) require Windows 8 because they use a native Windows component ( websocket . dll ) that is new to Windows 8 . Once you are running on Windows 8 you can turn on the IIS WebSocket module under " Turn Windows features on or off " - > Internet Information Services - > World Wide Web Services > Application Development Features - > WebSocket Protocol
function WebSocketTest() {
    if ("WebSocket" in window) {
        var ws = new WebSocket("ws://banl07r9ameaf/HTML5Demo/");
        ws.onopen = function () {
            ws.send("Message sent to server");
            alert("Message was sent to server.");
        };
        ws.onmessage = function (evt) {
            var receivedmsg = evt.data;
            alert("Message is received from server"+ receivedmsg);
        };
        ws.onclose = function () {
            alert("Connection is closed.");
        };
        ws.onerror = function (evt) {
            alert("ERROR!!! " + evt.message);
        };
    }
}
function WebSocketTest ( ) { if ( "WebSocket" in window ) { var ws = new WebSocket ( "ws://banl07r9ameaf/HTML5Demo/" ) ; ws . onopen = function ( ) { ws . send ( "Message sent to server" ) ; alert ( "Message was sent to server." ) ; } ; ws . onmessage = function ( evt ) { var receivedmsg = evt . data ; alert ( "Message is received from server" + receivedmsg ) ; } ; ws . onclose = function ( ) { alert ( "Connection is closed." ) ; } ; ws . onerror = function ( evt ) { alert ( "ERROR!!! " + evt . message ) ; } ; } }
Learned from web:
The WebSocket features in .NET 4.5 and IIS 8 (including Express) require Windows 8
because they use a native Windows component (websocket.dll) that is new to Windows 8.
Learned from web : The WebSocket features in . NET 4 . 5 and IIS 8 ( including Express ) require Windows 8 because they use a native Windows component ( websocket . dll ) that is new to Windows 8 .
// Open a Web Socket // Send data //Recieve data // Close a Websocket // Log Error