Skip to content

Commit

Permalink
fix: close connection when running in mobile wifi proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbekhen committed Sep 24, 2023
1 parent ebf7174 commit 898ca97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion webproxy/webproxy.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package webproxy

import (
"fmt"
"github.com/gofiber/fiber/v2"
"github.com/valyala/fasthttp"
"io"
Expand Down Expand Up @@ -60,8 +61,9 @@ func (s *WebProxy) handleHTTP(c *fiber.Ctx) error {

// handleTunneling handles CONNECT requests
func (s *WebProxy) handleTunneling(c *fiber.Ctx) error {
destConn, err := fasthttp.DialTimeout(c.Hostname(), s.TunnelTimeout)
destConn, err := fasthttp.DialTimeout(c.OriginalURL(), s.TunnelTimeout)
if err != nil {
fmt.Println(err)
return c.Status(fiber.StatusServiceUnavailable).SendString(err.Error())
}

Expand Down

0 comments on commit 898ca97

Please sign in to comment.