Comments (5)
I'm desperately asking for help right now, I can only hope for now
from gomitmproxy.
I extracted a simple example of the core http proxy of the gomitmproxy, which is printed normally in http
func main() {
listenAddr := &net.TCPAddr{
IP: net.IPv4(0, 0, 0, 0),
Port: 8080,
}
l, err := net.ListenTCP("tcp", listenAddr)
if err != nil {
}
log.Printf("start listening to %s", l.Addr())
conn, err := l.Accept()
log.Printf("remote addr is %s", conn.RemoteAddr())
log.Printf("local addr is %s", conn.LocalAddr())
localRW := bufio.NewReadWriter(bufio.NewReader(conn), bufio.NewWriter(conn))
var req *http.Request
reqc := make(chan *http.Request, 1)
errc := make(chan error, 1)
go func() {
r, err := http.ReadRequest(localRW.Reader)
if err != nil {
errc <- err
return
}
reqc <- r
}()
req = <-reqc
log.Println(req)
}
It can be obtained normally, but if the proxy is transparent, how should this code be changed?
2022/04/07 15:52:09 start listening to [::]:8080
2022/04/07 15:52:11 remote addr is 192.168.1.23:59812
2022/04/07 15:52:11 local addr is 192.168.1.23:8080
2022/04/07 15:52:11 &{CONNECT //www.google.com:443 HTTP/1.1 1 1 map[Proxy-Connection:[keep-alive] User-Agent:[Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4774.0 Safari/537.36]] {} <nil> 0 [] false www.google.com:443 map[] map[] <nil> map[] www.google.com:443 <nil> <nil> <nil> <nil>}
from gomitmproxy.
If the official can give a simple example of modification, it would be great, thank you very much
from gomitmproxy.
Well, the problem is that currently it simply does not support the transparent proxy approach, it expects to be used as a normal proxy. The code requires substantial changes to support this.
from gomitmproxy.
Well, the problem is that currently it simply does not support the transparent proxy approach, it expects to be used as a normal proxy. The code requires substantial changes to support this.
If you add a transparent proxy, roughly what you need to do? Is it first to initiate a CONNECT request to gomitmproxy through TCP for iptable traffic, when encountering HTTPS traffic? It seems that if a third-party transparent proxy (support upstream is HTTP https://github.com/xiqingping/transproxy) is connected between iptable and gomitmproxy, it can be used, but I want to integrate the transparent proxy function into gomitmproxy (this way I don’t need to open another program), but due to my limited personal ability, I can’t implement it yet. Can the author provide some ideas?
from gomitmproxy.
Related Issues (16)
- first record does not look like a TLS handshake HOT 5
- The latest progress on adding support for transparent proxy to Gomitmproxy HOT 3
- may cause the connection to end prematurely HOT 1
- may cause connection hang
- Make a guide on how to setup
- How to ignore upstream server certificate check?
- Is it possible to intercept and modify websocket with this?
- routines:CONNECT_CR_SRVR_HELLO:wrong version number HOT 4
- Segfault if client does not trust the proxy's SSL certificate
- if req.URL.Host is no hostname
- Redirect bug - failed to round trip: net/http: HTTP/1.x transport connection broken HOT 2
- Feat request: Please allow us to have access to transport config HOT 1
- server replay
- Http2 Support HOT 1
- tls first record does not look like a tls handshake HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gomitmproxy.