notedit / rtclive

(WIP)A WebRTC Edge Low Latency Broadcast Server
MIT License
73 stars 22 forks source link

网页客户端ws链接的时候,服务端报错。 #4

Closed daozhao closed 5 years ago

daozhao commented 5 years ago

按照下边运行

git clone https://github.com/notedit/RTCLive.git cd RTCLive go run main.go -c config.yaml

我使用player.html页面进行测试。 使用ffmpeg推流: ffmpeg -re -i IMG_2817.mp4 -vcodec copy -acodec copy -f flv rtmp://localhost/live/test_streamID

chrome现实js错误: WebSocket connection to 'ws://127.0.0.1:5000/ws' failed: Connection closed before receiving a handshake response

服务的报错: http: panic serving 127.0.0.1:55059: runtime error: invalid memory address or nil pointer dereference goroutine 36 [running]: net/http.(conn).serve.func1(0xc0000e41e0) /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:1746 +0xd0 panic(0x48dbd60, 0x4fd5110) /usr/local/Cellar/go/1.11.4/libexec/src/runtime/panic.go:513 +0x1b9 github.com/gin-gonic/gin.(Engine).ServeHTTP(0x0, 0x4a91a60, 0xc0001b0000, 0xc000254100) /Users/daozhao/Documents/SourceCode/GOPATH/pkg/mod/github.com/gin-gonic/gin@v1.3.0/gin.go:321 +0x26 net/http.serverHandler.ServeHTTP(0xc00020e750, 0x4a91a60, 0xc0001b0000, 0xc000254100) /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:2741 +0xab net/http.(conn).serve(0xc0000e41e0, 0x4a92620, 0xc0001f8040) /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:1847 +0x646 created by net/http.(Server).Serve /usr/local/Cellar/go/1.11.4/libexec/src/net/http/server.go:2851 +0x2f5

我这边系统是MacOS 10.13.6 go version go1.11.4 darwin/amd64

notedit commented 5 years ago

看起来是http server的问题, 周末看一下

notedit commented 5 years ago

fixed