@@ -2,3 +2,41 @@ websocket_proxpy
2
2
================
3
3
4
4
A simple WebSocket proxy server implemented in Python 3.
5
+
6
+ --------------------------------------------------------
7
+
8
+ This server can run in one of two different modes:
9
+
10
+ 1 . OPEN_URL, where the connecting client provides a url to connect to via the proxy
11
+ 2 . FORCED_URL, where the server is hardwired to connect to one and only one url
12
+
13
+ == Requirements ==
14
+
15
+ 1 . Python 3 (tested on Python 3.4)
16
+ 2 . The 'websockets' module
17
+ 3 . The 'yaml' module
18
+
19
+ == Instructions ==
20
+
21
+ 1 . In config.yaml, ensure serverType is set to "OPEN_URL" (to allow clients to choose which URL to connect to) or
22
+ "FORCED_URL" (to make the proxy always connect the client to the same url)
23
+
24
+ 2 . If you are using FORCED_URL, uncomment and set proxiedUrl to a valid websocket url. Otherwise it should be commented out with a "#"
25
+
26
+ 3 . Set the other configuration options, such as host, post, passphrase
27
+
28
+ 4 . From within the project root, launch proxy.py
29
+
30
+ 5 . Connect from a websocket client to the host/port in config.yaml, and send the password in json like so:
31
+
32
+ {"password": "12345"}
33
+
34
+ You will receive a json response where "status" is either "ok" or "error" with an elaboration in "message.
35
+
36
+ 6 . If you are using FORCED_URL, skip this step. Otherwise send the url you wish to connect to in json, like so:
37
+
38
+ {"url": "ws://localhost:8081/test"}
39
+
40
+ You will receive a json response where "status" is either "ok" or "error" with an elaboration in "message.
41
+
42
+ 7 . Send X amount of further requests to pass along whatever you intend to send to the proxied websocket.
0 commit comments