Skip to content

Commit 6b4c957

Browse files
committed
simplify readme
1 parent 84a9e4c commit 6b4c957

File tree

1 file changed

+17
-36
lines changed

1 file changed

+17
-36
lines changed

README.md

+17-36
Original file line numberDiff line numberDiff line change
@@ -16,58 +16,39 @@ Usage:
1616
```
1717

1818

19-
# Package wsproxy
19+
# wsproxy
20+
import "github.com/tmc/grpc-websocket-proxy/wsproxy"
2021

21-
`import "github.com/tmc/grpc-websocket-proxy/wsproxy"`
22-
23-
* [Overview](#pkg-overview)
24-
* [Index](#pkg-index)
25-
26-
## <a name="pkg-overview">Overview</a>
2722
Package wsproxy implements a websocket proxy for grpc-gateway backed services
2823

24+
## Usage
2925

30-
31-
32-
## <a name="pkg-index">Index</a>
33-
* [Variables](#pkg-variables)
34-
* [func WebsocketProxy(h http.Handler) http.HandlerFunc](#WebsocketProxy)
35-
36-
37-
#### <a name="pkg-files">Package files</a>
38-
[doc.go](/src/github.com/tmc/grpc-websocket-proxy/wsproxy/doc.go) [websocket_proxy.go](/src/github.com/tmc/grpc-websocket-proxy/wsproxy/websocket_proxy.go)
39-
40-
41-
42-
## <a name="pkg-variables">Variables</a>
43-
``` go
26+
```go
4427
var (
45-
MethodOverrideParam = "method"
46-
TokenCookieName = "token"
28+
MethodOverrideParam = "method"
29+
TokenCookieName = "token"
4730
)
4831
```
4932

33+
#### func WebsocketProxy
5034

51-
## <a name="WebsocketProxy">func</a> [WebsocketProxy](/src/target/websocket_proxy.go?s=758:810#L21)
52-
``` go
35+
```go
5336
func WebsocketProxy(h http.Handler) http.HandlerFunc
5437
```
55-
WebsocketProxy attempts to expose the underlying handler as a bidi websocket stream with newline-delimited
56-
JSON as the content encoding.
38+
WebsocketProxy attempts to expose the underlying handler as a bidi websocket
39+
stream with newline-delimited JSON as the content encoding.
5740

58-
The HTTP Authorization header is either populated from the Sec-Websocket-Protocol field or by a cookie.
59-
The cookie name is specified by the TokenCookieName value.
41+
The HTTP Authorization header is either populated from the
42+
Sec-Websocket-Protocol field or by a cookie. The cookie name is specified by the
43+
TokenCookieName value.
6044

6145
example:
6246

63-
64-
Sec-Websocket-Protocol: Bearer, foobar
47+
Sec-Websocket-Protocol: Bearer, foobar
6548

6649
is converted to:
6750

51+
Authorization: Bearer foobar
6852

69-
Authorization: Bearer foobar
70-
71-
Method can be overwritten with the MethodOverrideParam get parameter in the requested URL
72-
73-
53+
Method can be overwritten with the MethodOverrideParam get parameter in the
54+
requested URL

0 commit comments

Comments
 (0)