Giter Site home page Giter Site logo

goproxy and transparent mode about goproxy HOT 7 CLOSED

elazarl avatar elazarl commented on September 26, 2024
goproxy and transparent mode

from goproxy.

Comments (7)

elazarl avatar elazarl commented on September 26, 2024

Hi,

Thanks for the kind words, and thanks for reporting the bug.

Can you write a more detailed, step-by-step instructions how to recreate the problem?

Thanks,

from goproxy.

 avatar commented on September 26, 2024

Here it is:

// On my router

$ iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
$ cat main.go
package main

import (
"github.com/elazarl/goproxy"
"log"
"net/http"
)

func main() {
proxy := goproxy.NewProxyHttpServer()
proxy.OnResponse().DoFunc(
func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response {
log.Println("Resp = ", resp)
return resp
})
proxy.Verbose = true
log.Fatal(http.ListenAndServe(":8080", proxy))
}

// At other side I'm starting chromium without proxy, and get this: unsupported protocol scheme ""

$ go run *
2013/12/03 18:28:43 [001] INFO: Got request GET /
2013/12/03 18:28:43 [001] INFO: Sending request GET /
2013/12/03 18:28:43 Resp =
2013/12/03 18:28:43 [001] INFO: error read response unsupported protocol scheme "":
2013/12/03 18:28:43 [002] INFO: Got request GET /favicon.ico
2013/12/03 18:28:43 [002] INFO: Sending request GET /favicon.ico
2013/12/03 18:28:43 Resp =
2013/12/03 18:28:43 [002] INFO: error read response unsupported protocol scheme "":

from goproxy.

elazarl avatar elazarl commented on September 26, 2024

@alxchk

Can you test it now, and let me know if it works for you?

Thanks,

from goproxy.

 avatar commented on September 26, 2024

Unfortunately, issue stil present:

$ go run *
2013/12/04 11:15:29 [001] INFO: Got request / ya.ru GET /
2013/12/04 11:15:29 [001] INFO: Sending request GET http://ya.ru/
2013/12/04 11:15:29 Resp =
2013/12/04 11:15:29 [001] INFO: error read response unsupported protocol scheme "":
2013/12/04 11:15:30 [002] INFO: Got request /favicon.ico ya.ru GET /favicon.ico
2013/12/04 11:15:30 [002] INFO: Sending request GET http://ya.ru/favicon.ico
2013/12/04 11:15:30 Resp =
2013/12/04 11:15:30 [002] INFO: error read response unsupported protocol scheme "":
2013/12/04 11:15:35 [003] INFO: Got request / linux.org.ru GET /
2013/12/04 11:15:35 [003] INFO: Sending request GET http://linux.org.ru/
2013/12/04 11:15:35 Resp =
2013/12/04 11:15:35 [003] INFO: error read response unsupported protocol scheme "":

And in browser:
unsupported protocol scheme ""

network dump: http://ge.tt/3EqEK771/v/0

from goproxy.

 avatar commented on September 26, 2024

Here is the fix: http://ix.io/9fq

from goproxy.

elazarl avatar elazarl commented on September 26, 2024

@alxchk ,

Thanks for submitting the patch. I've tried a somewhat different approach.

Can you please check and see if the new version works for you?

THanks,

from goproxy.

 avatar commented on September 26, 2024

Works ok, many thanks!

from goproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.