You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

687 lines
21 KiB

12 years ago
15 years ago
12 years ago
12 years ago
15 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
15 years ago
12 years ago
12 years ago
15 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
12 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
12 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
12 years ago
13 years ago
13 years ago
13 years ago
12 years ago
12 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
12 years ago
13 years ago
12 years ago
13 years ago
13 years ago
13 years ago
12 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
12 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
12 years ago
13 years ago
12 years ago
12 years ago
12 years ago
12 years ago
13 years ago
13 years ago
12 years ago
13 years ago
13 years ago
13 years ago
13 years ago
12 years ago
13 years ago
13 years ago
13 years ago
13 years ago
12 years ago
12 years ago
12 years ago
12 years ago
13 years ago
13 years ago
12 years ago
10 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
12 years ago
12 years ago
12 years ago
10 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
  1. ![Logo](websocket-sharp_logo.png)
  2. ## Welcome to websocket-sharp! ##
  3. websocket-sharp supports:
  4. - [RFC 6455](#supported-websocket-specifications)
  5. - [WebSocket Client](#websocket-client) and [Server](#websocket-server)
  6. - [Per-message Compression](#per-message-compression) extension
  7. - [Secure Connection](#secure-connection)
  8. - [HTTP Authentication](#http-authentication)
  9. - [Query string, Origin header, and Cookies](#query-string-origin-header-and-cookies)
  10. - [Connecting through the HTTP proxy server](#connecting-through-the-http-proxy-server)
  11. - .NET Framework **3.5** or later versions of .NET Framework (includes compatible environment such as [Mono])
  12. ## Branches ##
  13. - [master] for production releases.
  14. - [hybi-00] for older [draft-ietf-hybi-thewebsocketprotocol-00]. No longer maintained.
  15. - [draft75] for even more old [draft-hixie-thewebsocketprotocol-75]. No longer maintained.
  16. ## Build ##
  17. websocket-sharp is built as a single assembly, **websocket-sharp.dll**.
  18. websocket-sharp is developed with [MonoDevelop]. So a simple way to build is to open **websocket-sharp.sln** and run build for **websocket-sharp project** with any of the build configurations (e.g. `Debug`) in MonoDevelop.
  19. ## Install ##
  20. ### Self Build ###
  21. You should add your websocket-sharp.dll (e.g. `/path/to/websocket-sharp/bin/Debug/websocket-sharp.dll`) to the library references of your project.
  22. If you would like to use that dll in your [Unity] project, you should add it to any folder of your project (e.g. `Assets/Plugins`) in the **Unity Editor**.
  23. ### NuGet Gallery ###
  24. websocket-sharp is available on the [NuGet Gallery], as still a **prerelease** version.
  25. - [NuGet Gallery: websocket-sharp]
  26. You can add websocket-sharp to your project with the NuGet Package Manager, by using the following command in the Package Manager Console.
  27. PM> Install-Package WebSocketSharp -Pre
  28. ## Usage ##
  29. ### WebSocket Client ###
  30. ```csharp
  31. using System;
  32. using WebSocketSharp;
  33. namespace Example
  34. {
  35. public class Program
  36. {
  37. public static void Main (string[] args)
  38. {
  39. using (var ws = new WebSocket ("ws://dragonsnest.far/Laputa")) {
  40. ws.OnMessage += (sender, e) =>
  41. Console.WriteLine ("Laputa says: " + e.Data);
  42. ws.Connect ();
  43. ws.Send ("BALUS");
  44. Console.ReadKey (true);
  45. }
  46. }
  47. }
  48. }
  49. ```
  50. #### Step 1 ####
  51. Required namespace.
  52. ```csharp
  53. using WebSocketSharp;
  54. ```
  55. The `WebSocket` class exists in the `WebSocketSharp` namespace.
  56. #### Step 2 ####
  57. Creating a new instance of the `WebSocket` class with the WebSocket URL to connect.
  58. ```csharp
  59. var ws = new WebSocket ("ws://example.com");
  60. ```
  61. The `WebSocket` class inherits the `System.IDisposable` interface, so you can create it with the `using` statement.
  62. ```csharp
  63. using (var ws = new WebSocket ("ws://example.com")) {
  64. ...
  65. }
  66. ```
  67. This will **close** the WebSocket connection with status code `1001` (going away) when the control leaves the `using` block.
  68. #### Step 3 ####
  69. Setting the `WebSocket` events.
  70. ##### WebSocket.OnOpen Event #####
  71. This event occurs when the WebSocket connection has been established.
  72. ```csharp
  73. ws.OnOpen += (sender, e) => {
  74. ...
  75. };
  76. ```
  77. `System.EventArgs.Empty` is passed as `e`, so you do not need to use it.
  78. ##### WebSocket.OnMessage Event #####
  79. This event occurs when the `WebSocket` instance receives a message.
  80. ```csharp
  81. ws.OnMessage += (sender, e) => {
  82. ...
  83. };
  84. ```
  85. A `WebSocketSharp.MessageEventArgs` instance is passed as `e`.
  86. If you would like to get the message data, you should access `e.Data` or `e.RawData` property.
  87. `e.Data` property returns a `string`, so it is mainly used to get the **text** message data.
  88. `e.RawData` property returns a `byte[]`, so it is mainly used to get the **binary** message data.
  89. ```csharp
  90. if (e.IsText) {
  91. // Do something with e.Data.
  92. ...
  93. return;
  94. }
  95. if (e.IsBinary) {
  96. // Do something with e.RawData.
  97. ...
  98. return;
  99. }
  100. ```
  101. And if you would like to notify that a **ping** has been received, via this event, you should set the `WebSocket.EmitOnPing` property to `true`.
  102. ```csharp
  103. ws.EmitOnPing = true;
  104. ws.OnMessage += (sender, e) => {
  105. if (e.IsPing) {
  106. // Do something to notify that a ping has been received.
  107. ...
  108. return;
  109. }
  110. };
  111. ```
  112. ##### WebSocket.OnError Event #####
  113. This event occurs when the `WebSocket` instance gets an error.
  114. ```csharp
  115. ws.OnError += (sender, e) => {
  116. ...
  117. };
  118. ```
  119. A `WebSocketSharp.ErrorEventArgs` instance is passed as `e`.
  120. If you would like to get the error message, you should access `e.Message` property.
  121. `e.Message` property returns a `string` that represents the error message.
  122. And `e.Exception` property returns a `System.Exception` instance that represents the cause of the error if it is due to an exception.
  123. ##### WebSocket.OnClose Event #####
  124. This event occurs when the WebSocket connection has been closed.
  125. ```csharp
  126. ws.OnClose += (sender, e) => {
  127. ...
  128. };
  129. ```
  130. A `WebSocketSharp.CloseEventArgs` instance is passed as `e`.
  131. If you would like to get the reason for the close, you should access `e.Code` or `e.Reason` property.
  132. `e.Code` property returns a `ushort` that represents the status code for the close.
  133. `e.Reason` property returns a `string` that represents the reason for the close.
  134. #### Step 4 ####
  135. Connecting to the WebSocket server.
  136. ```csharp
  137. ws.Connect ();
  138. ```
  139. If you would like to connect to the server asynchronously, you should use the `WebSocket.ConnectAsync ()` method.
  140. #### Step 5 ####
  141. Sending data to the WebSocket server.
  142. ```csharp
  143. ws.Send (data);
  144. ```
  145. The `WebSocket.Send` method is overloaded.
  146. You can use the `WebSocket.Send (string)`, `WebSocket.Send (byte[])`, `WebSocket.Send (System.IO.FileInfo)`, or `WebSocket.Send (System.IO.Stream, int)` method to send the data.
  147. If you would like to send the data asynchronously, you should use the `WebSocket.SendAsync` method.
  148. ```csharp
  149. ws.SendAsync (data, completed);
  150. ```
  151. And also if you would like to do something when the send is complete, you should set `completed` to any `Action<bool>` delegate.
  152. #### Step 6 ####
  153. Closing the WebSocket connection.
  154. ```csharp
  155. ws.Close (code, reason);
  156. ```
  157. If you would like to close the connection explicitly, you should use the `WebSocket.Close` method.
  158. The `WebSocket.Close` method is overloaded.
  159. You can use the `WebSocket.Close ()`, `WebSocket.Close (ushort)`, `WebSocket.Close (WebSocketSharp.CloseStatusCode)`, `WebSocket.Close (ushort, string)`, or `WebSocket.Close (WebSocketSharp.CloseStatusCode, string)` method to close the connection.
  160. If you would like to close the connection asynchronously, you should use the `WebSocket.CloseAsync` method.
  161. ### WebSocket Server ###
  162. ```csharp
  163. using System;
  164. using WebSocketSharp;
  165. using WebSocketSharp.Server;
  166. namespace Example
  167. {
  168. public class Laputa : WebSocketBehavior
  169. {
  170. protected override void OnMessage (MessageEventArgs e)
  171. {
  172. var msg = e.Data == "BALUS"
  173. ? "Are you kidding?"
  174. : "I'm not available now.";
  175. Send (msg);
  176. }
  177. }
  178. public class Program
  179. {
  180. public static void Main (string[] args)
  181. {
  182. var wssv = new WebSocketServer ("ws://dragonsnest.far");
  183. wssv.AddWebSocketService<Laputa> ("/Laputa");
  184. wssv.Start ();
  185. Console.ReadKey (true);
  186. wssv.Stop ();
  187. }
  188. }
  189. }
  190. ```
  191. #### Step 1 ####
  192. Required namespace.
  193. ```csharp
  194. using WebSocketSharp.Server;
  195. ```
  196. The `WebSocketBehavior` and `WebSocketServer` classes exist in the `WebSocketSharp.Server` namespace.
  197. #### Step 2 ####
  198. Creating the class that inherits the `WebSocketBehavior` class.
  199. For example, if you would like to provide an echo service,
  200. ```csharp
  201. using System;
  202. using WebSocketSharp;
  203. using WebSocketSharp.Server;
  204. public class Echo : WebSocketBehavior
  205. {
  206. protected override void OnMessage (MessageEventArgs e)
  207. {
  208. Send (e.Data);
  209. }
  210. }
  211. ```
  212. And if you would like to provide a chat service,
  213. ```csharp
  214. using System;
  215. using WebSocketSharp;
  216. using WebSocketSharp.Server;
  217. public class Chat : WebSocketBehavior
  218. {
  219. private string _suffix;
  220. public Chat ()
  221. {
  222. _suffix = String.Empty;
  223. }
  224. public string Suffix {
  225. get {
  226. return _suffix;
  227. }
  228. set {
  229. _suffix = value ?? String.Empty;
  230. }
  231. }
  232. protected override void OnMessage (MessageEventArgs e)
  233. {
  234. Sessions.Broadcast (e.Data + _suffix);
  235. }
  236. }
  237. ```
  238. You can define the behavior of any WebSocket service by creating the class that inherits the `WebSocketBehavior` class.
  239. If you override the `WebSocketBehavior.OnMessage (MessageEventArgs)` method, it will be called when the `WebSocket` used in a session in the service receives a message.
  240. And if you override the `WebSocketBehavior.OnOpen ()`, `WebSocketBehavior.OnError (ErrorEventArgs)`, and `WebSocketBehavior.OnClose (CloseEventArgs)` methods, each of them will be called when each of the `WebSocket` events (`OnOpen`, `OnError`, and `OnClose`) occurs.
  241. The `WebSocketBehavior.Send` method can send data to the client on a session in the service.
  242. If you would like to get the sessions in the service, you should access the `WebSocketBehavior.Sessions` property (returns a `WebSocketSharp.Server.WebSocketSessionManager`).
  243. The `WebSocketBehavior.Sessions.Broadcast` method can send data to every client in the service.
  244. #### Step 3 ####
  245. Creating a new instance of the `WebSocketServer` class.
  246. ```csharp
  247. var wssv = new WebSocketServer (4649);
  248. wssv.AddWebSocketService<Echo> ("/Echo");
  249. wssv.AddWebSocketService<Chat> ("/Chat");
  250. wssv.AddWebSocketService<Chat> ("/ChatWithNyan", s => s.Suffix = " Nyan!");
  251. ```
  252. You can add any WebSocket service to your `WebSocketServer` with the specified behavior and absolute path to the service, by using the `WebSocketServer.AddWebSocketService<TBehavior> (string)` or `WebSocketServer.AddWebSocketService<TBehavior> (string, Action<TBehavior>)` method.
  253. The type of `TBehavior` must inherit the `WebSocketBehavior` class, and must have a public parameterless constructor.
  254. So you can use a class in the above Step 2 to add the service.
  255. If you create a new instance of the `WebSocketServer` class without a port number, it sets the port number to **80**. So it is necessary to run with root permission.
  256. $ sudo mono example2.exe
  257. #### Step 4 ####
  258. Starting the WebSocket server.
  259. ```csharp
  260. wssv.Start ();
  261. ```
  262. #### Step 5 ####
  263. Stopping the WebSocket server.
  264. ```csharp
  265. wssv.Stop ();
  266. ```
  267. ### HTTP Server with the WebSocket ###
  268. I have modified the `System.Net.HttpListener`, `System.Net.HttpListenerContext`, and some other classes from **[Mono]** to create an HTTP server that allows to accept the WebSocket handshake requests.
  269. So websocket-sharp provides the `WebSocketSharp.Server.HttpServer` class.
  270. You can add any WebSocket service to your `HttpServer` with the specified behavior and path to the service, by using the `HttpServer.AddWebSocketService<TBehavior> (string)` or `HttpServer.AddWebSocketService<TBehavior> (string, Action<TBehavior>)` method.
  271. ```csharp
  272. var httpsv = new HttpServer (4649);
  273. httpsv.AddWebSocketService<Echo> ("/Echo");
  274. httpsv.AddWebSocketService<Chat> ("/Chat");
  275. httpsv.AddWebSocketService<Chat> ("/ChatWithNyan", s => s.Suffix = " Nyan!");
  276. ```
  277. For more information, would you see **[Example3]**?
  278. ### WebSocket Extensions ###
  279. #### Per-message Compression ####
  280. websocket-sharp supports the [Per-message Compression][rfc7692] extension (but does not support it with the [context take over]).
  281. As a WebSocket client, if you would like to enable this extension, you should set the `WebSocket.Compression` property to a compression method before calling the connect method.
  282. ```csharp
  283. ws.Compression = CompressionMethod.Deflate;
  284. ```
  285. And then the client will send the following header in the handshake request to the server.
  286. Sec-WebSocket-Extensions: permessage-deflate; server_no_context_takeover; client_no_context_takeover
  287. If the server supports this extension, it will return the same header which has the corresponding value.
  288. So eventually this extension will be available when the client receives the header in the handshake response.
  289. #### Ignoring the extensions ####
  290. As a WebSocket server, if you would like to ignore the extensions requested from a client, you should set the `WebSocketBehavior.IgnoreExtensions` property to `true` in your `WebSocketBehavior` constructor or initializing it, such as the following.
  291. ```csharp
  292. wssv.AddWebSocketService<Chat> (
  293. "/Chat",
  294. s => s.IgnoreExtensions = true // To ignore the extensions requested from a client.
  295. );
  296. ```
  297. If it is set to `true`, the service will not return the Sec-WebSocket-Extensions header in its handshake response.
  298. I think this is useful when you get something error in connecting the server and exclude the extensions as a cause of the error.
  299. ### Secure Connection ###
  300. websocket-sharp supports the secure connection with **SSL/TLS**.
  301. As a WebSocket client, you should create a new instance of the `WebSocket` class with a **wss** scheme WebSocket URL.
  302. ```csharp
  303. var ws = new WebSocket ("wss://example.com");
  304. ```
  305. If you would like to set a custom validation for the server certificate, you should set the `WebSocket.SslConfiguration.ServerCertificateValidationCallback` property to a callback for it.
  306. ```csharp
  307. ws.SslConfiguration.ServerCertificateValidationCallback =
  308. (sender, certificate, chain, sslPolicyErrors) => {
  309. // Do something to validate the server certificate.
  310. ...
  311. return true; // If the server certificate is valid.
  312. };
  313. ```
  314. The default callback always returns `true`.
  315. As a WebSocket server, you should create a new instance of the `WebSocketServer` or `HttpServer` class with some settings for the secure connection, such as the following.
  316. ```csharp
  317. var wssv = new WebSocketServer (5963, true);
  318. wssv.SslConfiguration.ServerCertificate = new X509Certificate2 (
  319. "/path/to/cert.pfx", "password for cert.pfx"
  320. );
  321. ```
  322. ### HTTP Authentication ###
  323. websocket-sharp supports the [HTTP Authentication (Basic/Digest)][rfc2617].
  324. As a WebSocket client, you should set a pair of user name and password for the HTTP authentication, by using the `WebSocket.SetCredentials (string, string, bool)` method before calling the connect method.
  325. ```csharp
  326. ws.SetCredentials ("nobita", "password", preAuth);
  327. ```
  328. If `preAuth` is `true`, the client will send the credentials for the Basic authentication in the first handshake request to the server.
  329. Otherwise, it will send the credentials for either the Basic or Digest (determined by the unauthorized response to the first handshake request) authentication in the second handshake request to the server.
  330. As a WebSocket server, you should set an HTTP authentication scheme, a realm, and any function to find the user credentials before calling the start method, such as the following.
  331. ```csharp
  332. wssv.AuthenticationSchemes = AuthenticationSchemes.Basic;
  333. wssv.Realm = "WebSocket Test";
  334. wssv.UserCredentialsFinder = id => {
  335. var name = id.Name;
  336. // Return user name, password, and roles.
  337. return name == "nobita"
  338. ? new NetworkCredential (name, "password", "gunfighter")
  339. : null; // If the user credentials are not found.
  340. };
  341. ```
  342. If you would like to provide the Digest authentication, you should set such as the following.
  343. ```csharp
  344. wssv.AuthenticationSchemes = AuthenticationSchemes.Digest;
  345. ```
  346. ### Query string, Origin header, and Cookies ###
  347. As a WebSocket client, if you would like to send the query string in the handshake request, you should create a new instance of the `WebSocket` class with a WebSocket URL that includes the [Query] string parameters.
  348. ```csharp
  349. var ws = new WebSocket ("ws://example.com/?name=nobita");
  350. ```
  351. And if you would like to send the Origin header in the handshake request, you should set the `WebSocket.Origin` property to an allowable value as the [Origin] header before calling the connect method.
  352. ```csharp
  353. ws.Origin = "http://example.com";
  354. ```
  355. And also if you would like to send the cookies in the handshake request, you should set any cookie by using the `WebSocket.SetCookie (WebSocketSharp.Net.Cookie)` method before calling the connect method.
  356. ```csharp
  357. ws.SetCookie (new Cookie ("name", "nobita"));
  358. ```
  359. As a WebSocket server, if you would like to get the query string included in a handshake request, you should access the `WebSocketBehavior.QueryString` property, such as the following.
  360. ```csharp
  361. public class Chat : WebSocketBehavior
  362. {
  363. private string _name;
  364. ...
  365. protected override void OnOpen ()
  366. {
  367. _name = QueryString["name"];
  368. }
  369. ...
  370. }
  371. ```
  372. And if you would like to validate the Origin header, cookies, or both, you should set each validation for it with your `WebSocketBehavior`, for example, by using the `WebSocketServer.AddWebSocketService<TBehavior> (string, Action<TBehavior>)` method with initializing, such as the following.
  373. ```csharp
  374. wssv.AddWebSocketService<Chat> (
  375. "/Chat",
  376. s => {
  377. s.OriginValidator =
  378. val => {
  379. // Check the value of the Origin header, and return true if valid.
  380. Uri origin;
  381. return !val.IsNullOrEmpty ()
  382. && Uri.TryCreate (val, UriKind.Absolute, out origin)
  383. && origin.Host == "example.com";
  384. };
  385. s.CookiesValidator =
  386. (req, res) => {
  387. // Check the cookies in "req", and set the cookies to send to
  388. // the client with "res" if necessary.
  389. foreach (var cookie in req) {
  390. cookie.Expired = true;
  391. res.Add (cookie);
  392. }
  393. return true; // If valid.
  394. };
  395. }
  396. );
  397. ```
  398. ### Connecting through the HTTP proxy server ###
  399. websocket-sharp supports to connect through the HTTP proxy server.
  400. If you would like to connect to a WebSocket server through the HTTP proxy server, you should set the proxy server URL, and if necessary, a pair of user name and password for the proxy server authentication (Basic/Digest), by using the `WebSocket.SetProxy (string, string, string)` method before calling the connect method.
  401. ```csharp
  402. var ws = new WebSocket ("ws://example.com");
  403. ws.SetProxy ("http://localhost:3128", "nobita", "password");
  404. ```
  405. I have tested this with **[Squid]**. It is necessary to disable the following option in **squid.conf** (e.g. `/etc/squid/squid.conf`).
  406. ```
  407. # Deny CONNECT to other than SSL ports
  408. #http_access deny CONNECT !SSL_ports
  409. ```
  410. ### Logging ###
  411. The `WebSocket` class has the own logging function.
  412. You can use it with the `WebSocket.Log` property (returns a `WebSocketSharp.Logger`).
  413. So if you would like to change the current logging level (`WebSocketSharp.LogLevel.Error` as the default), you should set the `WebSocket.Log.Level` property to any of the `LogLevel` enum values.
  414. ```csharp
  415. ws.Log.Level = LogLevel.Debug;
  416. ```
  417. The above means a log with lower than `LogLevel.Debug` cannot be outputted.
  418. And if you would like to output a log, you should use any of the output methods. The following outputs a log with `LogLevel.Debug`.
  419. ```csharp
  420. ws.Log.Debug ("This is a debug message.");
  421. ```
  422. The `WebSocketServer` and `HttpServer` classes have the same logging function.
  423. ## Examples ##
  424. Examples using websocket-sharp.
  425. ### Example ###
  426. [Example] connects to the server executed by [Example2] or [Example3].
  427. ### Example2 ###
  428. [Example2] starts a WebSocket server.
  429. ### Example3 ###
  430. [Example3] starts an HTTP server that allows to accept the WebSocket handshake requests.
  431. Would you access to [http://localhost:4649](http://localhost:4649) to do **WebSocket Echo Test** with your web browser while Example3 is running?
  432. ## Supported WebSocket Specifications ##
  433. websocket-sharp supports **RFC 6455**, and it is based on the following references:
  434. - [The WebSocket Protocol][rfc6455]
  435. - [The WebSocket API][api]
  436. - [Compression Extensions for WebSocket][rfc7692]
  437. Thanks for translating to japanese.
  438. - [The WebSocket Protocol 日本語訳][rfc6455_ja]
  439. - [The WebSocket API 日本語訳][api_ja]
  440. ## License ##
  441. websocket-sharp is provided under [The MIT License].
  442. [Example]: https://github.com/sta/websocket-sharp/tree/master/Example
  443. [Example2]: https://github.com/sta/websocket-sharp/tree/master/Example2
  444. [Example3]: https://github.com/sta/websocket-sharp/tree/master/Example3
  445. [Mono]: http://www.mono-project.com
  446. [MonoDevelop]: http://monodevelop.com
  447. [NuGet Gallery]: http://www.nuget.org
  448. [NuGet Gallery: websocket-sharp]: http://www.nuget.org/packages/WebSocketSharp
  449. [Origin]: http://tools.ietf.org/html/rfc6454#section-7
  450. [Query]: http://tools.ietf.org/html/rfc3986#section-3.4
  451. [Squid]: http://www.squid-cache.org
  452. [The MIT License]: https://raw.github.com/sta/websocket-sharp/master/LICENSE.txt
  453. [Unity]: http://unity3d.com
  454. [api]: http://www.w3.org/TR/websockets
  455. [api_ja]: http://www.hcn.zaq.ne.jp/___/WEB/WebSocket-ja.html
  456. [context take over]: https://datatracker.ietf.org/doc/html/rfc7692#section-7.1.1
  457. [draft-hixie-thewebsocketprotocol-75]: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75
  458. [draft-ietf-hybi-thewebsocketprotocol-00]: http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00
  459. [draft75]: https://github.com/sta/websocket-sharp/tree/draft75
  460. [hybi-00]: https://github.com/sta/websocket-sharp/tree/hybi-00
  461. [master]: https://github.com/sta/websocket-sharp/tree/master
  462. [rfc2617]: http://tools.ietf.org/html/rfc2617
  463. [rfc6455]: http://tools.ietf.org/html/rfc6455
  464. [rfc6455_ja]: http://www.hcn.zaq.ne.jp/___/WEB/RFC6455-ja.html
  465. [rfc7692]: https://datatracker.ietf.org/doc/html/rfc7692