aboutsummaryrefslogtreecommitdiff
path: root/lib/websocket/examples
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2019-12-04 23:33:28 +0700
committerShulhan <m.shulhan@gmail.com>2019-12-04 23:59:13 +0700
commit738e4bbf515fed9a33430d9c474715dce242d338 (patch)
tree3320d3999dc7e9157e1c8d9221980bb79e2c30f2 /lib/websocket/examples
parenteaf16a54fcb430885578c03e4e246af14966f033 (diff)
downloadpakakeh.go-738e4bbf515fed9a33430d9c474715dce242d338.tar.xz
websocket: update documentation of AUTOBAHN and on examples
Diffstat (limited to 'lib/websocket/examples')
-rw-r--r--lib/websocket/examples/README.html90
1 files changed, 90 insertions, 0 deletions
diff --git a/lib/websocket/examples/README.html b/lib/websocket/examples/README.html
new file mode 100644
index 00000000..71aec923
--- /dev/null
+++ b/lib/websocket/examples/README.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="theme-color" content="#375EAB" />
+
+ <title></title>
+ </head>
+ <body>
+ <div class="topbar">
+ <div class="container">
+ <div class="top-heading">
+ <a href="/">github.com/shuLhan/share</a>
+ </div>
+ <div class="menu">
+ <a href="https://godoc.org/github.com/shuLhan/share">GoDoc</a>
+ </div>
+ <div class="menu">
+ <a href="/CHANGELOG.html">Changelog</a>
+ </div>
+ </div>
+ </div>
+
+ <div class="page">
+ <div class="container">
+ <h1></h1>
+ <div class="sect1">
+<h2 id="_websocket_examples">WebSocket examples</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>This package contains an example of chat server and client written using
+WebSocket.</p>
+</div>
+<div class="paragraph">
+<p>To run the WebSocket server, go to directory &#34;cmd/server&#34; and execute,</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ go run .</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>There are three known user in the server: &#34;Groot&#34;, &#34;Thanos&#34;, and &#34;Hulk&#34;; all
+of them are represented by ID 1, 2, and 3; in order.</p>
+</div>
+<div class="paragraph">
+<p>The client example is in directory &#34;cmd/client&#34;, go to that directory and
+connect to the server as user &#34;Groot&#34; by executing</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ go run . 1</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>or as user &#34;Thanos&#34;,</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ go run . 2</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>or as user &#34;Hulk&#34;,</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>$ go run . 2</pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Run the server and then two or three clients, and start chatting with each
+others.</p>
+</div>
+</div>
+</div>
+ </div>
+
+ </div>
+
+
+ <div class="footer">
+ Copyright 2019, Shulhan &lt;ms@kilabit.info&gt;. All rights reserved.
+ <br />
+ Use of this source code is governed by a BSD-style license that can be
+ found in the <a href="/LICENSE">LICENSE</a> file.
+ </div>
+ </body>
+</html>