haochen233 / socks5 Goto Github PK
View Code? Open in Web Editor NEWA Go library about socks5, supports all socks5 commands. That Provides server and client and easy to use. Compatible with socks4 and socks4a.
License: MIT License
A Go library about socks5, supports all socks5 commands. That Provides server and client and easy to use. Compatible with socks4 and socks4a.
License: MIT License
HI,I am new to go,I want to use this code to transport data in socks proxy connection,and i copy you example code and add some code as follows,but when connect is finished, the http request not use the proxy connection,could you have nay suggestions?thanks
package main
import (
"crypto/md5"
"fmt"
"io/ioutil"
"log"
"net/http"
"github.com/haochen233/socks5"
)
func main() {
var userStorage socks5.UserPwdStore = socks5.NewMemeryStore(md5.New(), "secret")
client := socks5.Client{
ProxyAddr: "192.168.66.1:1080",
Auth: map[socks5.METHOD]socks5.Authenticator{
socks5.NO_AUTHENTICATION_REQUIRED: &socks5.NoAuth{},
socks5.USERNAME_PASSWORD: &socks5.UserPwdAuth{UserPwdStore: userStorage},
},
}
conn, err := client.Connect(socks5.Version5, "www.soso.com:80")
if err != nil {
log.Fatal(err)
}
// code i add
_, err = conn.Write([]byte("GET / HTTP/1.1\r\n\r\n"))
if err != nil {
log.Fatal(err)
}
var httpBody string
var httpSize int
for {
b := make([]byte, 4096)
len, err := conn.Read(b)
if err != nil {
log.Fatal(err)
}
httpBody += string(b[:len])
httpSize += len
if b[len-1] == '\n' && len < 4096 {
break
}
}
log.Println(httpBody, httpSize)
conn.Close()
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.