improve proxy
This commit is contained in:
35
exp/funint/main.go
Normal file
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)
|
||||
|
Reference in New Issue
Block a user