improve proxy

This commit is contained in:
2022-05-02 11:36:24 -04:00
parent 50101c12b8
commit d284956268
5 changed files with 69 additions and 9 deletions
app
exp
funint
proxy
log
proxy

35
exp/funint/main.go Normal file

@@ -0,0 +1,35 @@
package main
import (
"fmt"
"net"
)
type Foo interface {
Bar()
}
func bar() {
fmt.Println("bar")
}
func run(f Foo) {
f.Bar()
}
type t struct {
Bar func()
}
type t2 struct {
}
func (t t2) Bar() {
bar()
}
func main() {
run(t2{})
var d net.Dialer
d.Cancel
}

@@ -4,12 +4,16 @@ import (
"fmt"
"io"
"log"
"net/http"
"go.balki.me/tss/proxy"
)
func main() {
client, err := proxy.GetClient("socks5://unix/run/tor/socks")
trans, err := proxy.GetTransport("socks5://unix/run/tor/socks")
client := &http.Client{
Transport: trans,
}
res, err := client.Get("https://ip.balki.me")
if err != nil {
log.Panicln(err)