File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -10,14 +10,10 @@ into your existing Go webserver to provide WebSocket reverse proxy.
10
10
go get github.com/koding/websocketproxy
11
11
```
12
12
13
- ## Usage
13
+ ## Example
14
14
15
15
Below is a simple app that runs on a server and proxies to the given backend url
16
16
17
- ``` bash
18
- go run proxy.go -backend ws://example.com -port 80
19
- ```
20
-
21
17
``` go
22
18
package main
23
19
@@ -46,3 +42,11 @@ func main() {
46
42
}
47
43
}
48
44
```
45
+
46
+ Save it as ` proxy.go ` and run as:
47
+
48
+
49
+ ``` bash
50
+ go run proxy.go -backend ws://example.com -port 80
51
+ ```
52
+
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ type WebsocketProxy struct {
36
36
// WebSocket connection. If nil, DefaultUpgrader is used.
37
37
Upgrader * websocket.Upgrader
38
38
39
- // Dialer contains options for connecting to WebSocket server.
39
+ // Dialer contains options for connecting to WebSocket server. If nil,
40
+ // DefaultDialer is used.
40
41
Dialer * websocket.Dialer
41
42
}
42
43
You can’t perform that action at this time.
0 commit comments