-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use the SDK's WebSocket Upgrade()
function
#234
Conversation
cmd/outline-ss-server/main.go
Outdated
defer wsConn.Close() | ||
ctx, contextCancel := context.WithCancel(context.Background()) | ||
defer contextCancel() | ||
conn := &replaceAddrConn{StreamConn: websocket.WrapConn(wsConn), raddr: &net.TCPAddr{IP: net.ParseIP(r.RemoteAddr)}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't wsConn already have the right remote address because of handlers.ProxyHeaders?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, handlers.ProxyHeaders
only moves the client IP into the request's RemoteAddr
. The wsConn.RemoteAddr()
is not altered.
2aa225f
to
a41761c
Compare
Upgrade()
func
Upgrade()
funcUpgrade()
function
Depends on Jigsaw-Code/outline-sdk#366.