a .NET websocket client implementation.

It originated from SuperWebSocket WebSocket Client. For better developing of the websocket client, it was separated from SuperWebSocket and was renamed to WebSocket4Net.

WebSocket4Net will provide websocket client implementation for many different kinds of runtime:

  • .Net 2.0
  • .Net 3.5
  • .Net 4.0
  • Mono
  • Silverlight
  • WindowsPhone
  • Xamarin.Android
  • Xamarin.iOS


  Mono Windows Phone


It is compatible with many websocket drafts:

  • Hybi-00
  • Hybi-10
  • RFC6455


NuGet Packagehttp://www.nuget.org/packages/WebSocket4Net


Demo code:  


using WebSocket4Net;
WebSocket websocket = new WebSocket("ws://localhost:2012/");
websocket.Opened += new EventHandler(websocket_Opened);
websocket.Error += new EventHandler<ErrorEventArgs>(websocket_Error);
websocket.Closed += new EventHandler(websocket_Closed);
websocket.MessageReceived += new EventHandler(websocket_MessageReceived);

private void websocket_Opened(object sender, EventArgs e)
     websocket.Send("Hello World!");



    Bitcoin: 1KwVcdHcH2yNHLJqVJtLfT8uwzKbFNphbb


GitHub Repository: https://github.com/kerryjiang/WebSocket4Net

Recommended .NET WebSocket Server

SuperWebSocket -  http://superwebsocket.codeplex.com/


Consult/feature request:


Author's LinkedIn profile: http://cn.linkedin.com/in/kerryjiang



Last edited Apr 12, 2014 at 3:35 PM by kerryjiang, version 52