Skip to content
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

null pointer error when using websockets #239

Closed
ohnorobo opened this issue Feb 17, 2025 · 2 comments · Fixed by #242
Closed

null pointer error when using websockets #239

ohnorobo opened this issue Feb 17, 2025 · 2 comments · Fixed by #242

Comments

@ohnorobo
Copy link

When getting started building ss-server I found this behavior

To reproduce

go run ./cmd/outline-ss-server -config=./cmd/outline-ss-server/config_example.yml

Then just from the browser hit either
http://127.0.0.1:8000/SECRET/udp or http://127.0.0.1:8000/SECRET/tcp

result

Feb 17 17:24:47.071 ERR failed to upgrade err="websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"
Feb 17 17:24:47.071 INF http: panic serving 127.0.0.1:61625: runtime error: invalid memory address or nil pointer dereference
goroutine 4 [running]:
net/http.(*conn).serve.func1()
	/usr/local/go/src/net/http/server.go:1947 +0xb0
panic({0x1027afa60?, 0x102b186b0?})
	/usr/local/go/src/runtime/panic.go:785 +0x124
main.(*OutlineServer).runConfig.func1.2.7({0x102843370?, 0x1400013c0e0?}, 0x1400013a140)
	/Users/2385180/Projects/outline-ss-server/cmd/outline-ss-server/main.go:348 +0xd8
net/http.HandlerFunc.ServeHTTP(0x1400013a140?, {0x102843370?, 0x1400013c0e0?}, 0x0?)
	/usr/local/go/src/net/http/server.go:2220 +0x38
main.(*OutlineServer).runConfig.func1.2.ProxyHeaders.21({0x102843370, 0x1400013c0e0}, 0x1400013a140)
	/Users/2385180/go/pkg/mod/github.com/gorilla/handlers@v0.0.0-20150720190736-60c7bfde3e33/proxy_headers.go:54 +0xc8
net/http.HandlerFunc.ServeHTTP(0x0?, {0x102843370?, 0x1400013c0e0?}, 0xb?)
	/usr/local/go/src/net/http/server.go:2220 +0x38
main.(*OutlineServer).runConfig.func1.2.StripPrefix.22({0x102843370, 0x1400013c0e0}, 0x1400013a000)
	/usr/local/go/src/net/http/server.go:2282 +0x228
net/http.HandlerFunc.ServeHTTP(0x140002dc000?, {0x102843370?, 0x1400013c0e0?}, 0x102573094?)
	/usr/local/go/src/net/http/server.go:2220 +0x38
net/http.(*ServeMux).ServeHTTP(0x0?, {0x102843370, 0x1400013c0e0}, 0x1400013a000)
	/usr/local/go/src/net/http/server.go:2747 +0x1b4
net/http.serverHandler.ServeHTTP({0x14000114ff0?}, {0x102843370?, 0x1400013c0e0?}, 0x6?)
	/usr/local/go/src/net/http/server.go:3210 +0xbc
net/http.(*conn).serve(0x1400012c090, {0x102843e08, 0x1400024fd10})
	/usr/local/go/src/net/http/server.go:2092 +0x4fc
created by net/http.(*Server).Serve in goroutine 51
	/usr/local/go/src/net/http/server.go:3360 +0x3dc
@ohnorobo
Copy link
Author

Related to the ongoing work in #228

@ohnorobo
Copy link
Author

for the record I'm synced at 35fc25e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants