Skip to content

Commit

Permalink
fix: http websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
huhu415 committed Nov 14, 2024
1 parent df0574b commit 4746a4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ release:
header: |
## 🥳Changes
- 加强了一点性能
- 增加卸载功能
- 增加了http to websocket功能
```sh
tar -xzvf uaProxy-linux-xxxxxxx.tar.gz # 解压
Expand Down
7 changes: 7 additions & 0 deletions handle/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ func handleHTTPConnection(bufioReader *bufio.Reader, serverConn net.Conn) {
logrus.Error(er)
return
}

if req.Header.Get("Upgrade") == "websocket" && req.Header.Get("Connection") == "Upgrade" {
logrus.Debug("this is websocket request")
break
}
}

handleNonHTTPConnection(bufioReader, serverConn)
}

func handleNonHTTPConnection(bufioReader *bufio.Reader, serverConn net.Conn) {
Expand Down

0 comments on commit 4746a4c

Please sign in to comment.