Skip to content

Commit

Permalink
修复不支持http的POST
Browse files Browse the repository at this point in the history
  • Loading branch information
xtccc committed Jan 29, 2025
1 parent 53a0334 commit 4222dc4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
http_proxy
http_proxy.log
http_proxy.exe
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
go build .
rm http_proxy.log
./http_proxy


GOOS=windows GOARCH=amd64 go build
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,18 @@ func handleConnectRequest(conn net.Conn) {
switch method {
case "CONNECT":
handleConnectRequest_https(conn, target, reqLine)
case "GET":

//除了CONNECT其余的都是http的协议,转给http的上游
default:
req, err := createHTTPRequest(reqLine)
if err != nil {
fmt.Println("createHTTPRequest error", err)
return
}
handleConnectRequest_http(conn, req)

default:
fmt.Println("Unsupported method:", method)
}
/* default:
fmt.Println("Unsupported method:", method)
} */

}

Expand Down

0 comments on commit 4222dc4

Please sign in to comment.