Enproxy
Chained HTTP proxy that supports arbitrary TCP traffic tunneled over HTTP proxies using encapsulated HTTP requests
Install / Use
/learn @getlantern/EnproxyREADME
enproxy

enproxy provides an implementation of net.Conn that sends and receives data to/ from a proxy using HTTP request/response pairs that encapsulate the data. This is useful when you need to tunnel arbitrary protocols over an HTTP proxy that doesn't support HTTP CONNECT. Content distribution networks are one example of such a proxy.
To open such a connection:
conn := &enproxy.Conn{
Addr: addr,
Config: &enproxy.Config{
DialProxy: func(addr string) (net.Conn, error) {
// This opens a TCP connection to the proxy
return net.Dial("tcp", proxyAddress)
},
NewRequest: func(method string, body io.Reader) (req *http.Request, err error) {
// This is called for every request from enproxy.Conn to the proxy
return http.NewRequest(method, "http://"+proxyAddress+"/", body)
},
},
}
err := conn.Connect()
if err == nil {
// start using conn as any other net.Conn
}
To start the corresponding proxy server:
proxy := &enproxy.Proxy{}
err := proxy.ListenAndServe(proxyAddress)
if err != nil {
log.Fatalf("Unable to listen and serve: %s", err)
}
Debugging
enproxy allows tracing various global metrics about connections, which can be
useful when debugging issues like file descriptor leaks. To enable this tracing,
just set the environment variable TRACE_CONN_STATE=true. This will cause the
program to output information like the below every 5 seconds:
---- Enproxy Connections----
Open: 34
Closing: 0
Blocked on Closing: 0
Blocked on Read: 33
Reading: 33
Reading Finishing: 0
Blocked on Write: 0
Writing: 33
Selecting: 33
Writing: 0
Write Pipe Open: 0
Request Pending: 0
Submitting Req.: 0
Processing Req.: 1
Posting Req. Fin: 0
Posting Resp: 0
Dialing First: 0
Redialing: 0
Doing Write: 0
Posting Response: 0
Writing Empty: 0
Finishing Body: 0
Finishing: 0
Requesting: 33
Requesting Finishing: 0
Related Skills
openhue
344.1kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
344.1kElevenLabs text-to-speech with mac-style say UX.
weather
344.1kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
