Skip to content

Commit

Permalink
Respond with 200 Ok on successful connection
Browse files Browse the repository at this point in the history
Otherwise the browser will wait forever.
  • Loading branch information
RoganDawes authored and elazarl committed Oct 21, 2020
1 parent 0581fc3 commit 00ad82a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/goproxy-eavesdropper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func main() {
clientBuf := bufio.NewReadWriter(bufio.NewReader(client), bufio.NewWriter(client))
remote, err := net.Dial("tcp", req.URL.Host)
orPanic(err)
client.Write([]byte("HTTP/1.1 200 Ok\r\n\r\n"))
remoteBuf := bufio.NewReadWriter(bufio.NewReader(remote), bufio.NewWriter(remote))
for {
req, err := http.ReadRequest(clientBuf.Reader)
Expand Down

0 comments on commit 00ad82a

Please sign in to comment.