This repository was archived by the owner on Feb 23, 2020. It is now read-only.
Commit 7f5584a 1 parent cd8cca6 commit 7f5584a Copy full SHA for 7f5584a
File tree 1 file changed +57
-0
lines changed
1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
This is used as echoing pings and data in the room.
4
4
5
+ ## Usage
6
+
7
+ ### Docker
8
+
9
+ To start server, run.
10
+ ` docker run -p 80:80 gametactic/cpp-echo `
11
+
12
+ Docker image is very minimal and currently it's size is under 5MB!
13
+
14
+ ### From Sources
15
+
16
+
17
+ Requirements:
18
+
19
+ - libboost
20
+ - cmake
21
+ - gcc
22
+ - websocketspp
23
+
24
+ To build server itself, run:
25
+ ```
26
+ git clone https://github.com/GameTactic/CPP-Echo.git echo
27
+ cd echo
28
+ cmake .
29
+ make -j $(nproc --all) && make install
30
+ ```
31
+
32
+ After this server can be ran by:
33
+ ```
34
+ bin/server
35
+ ```
36
+
37
+ Server will automatically bind into port 80.
38
+
39
+ ### Server Usage
40
+
41
+ To use this server you should open websocket connection to port 80.
42
+ After this have been done, you need to specify room to listen.
43
+ This can be done by sending following data to server:
44
+
45
+ ```
46
+ join:xxxx
47
+ ```
48
+
49
+ In response you should get:
50
+
51
+ ``` json
52
+ {"success" :" Room xxxx selected." }
53
+ ```
54
+
55
+ If you try send message without first specifying room, you will get:
56
+ ``` json
57
+ {"error" :" No room selected." }
58
+ ```
59
+
60
+ Any futher messages sent after room selection will be just echo to everybody.
61
+
5
62
## Contributing
6
63
7
64
1 . Fork it!
You can’t perform that action at this time.
0 commit comments