mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 22:45:13 +00:00
sample socks proxy
This commit is contained in:
1 parent
0a96b8fb1d
commit
262eb4f985
10 files changed
+184
-31
No files matched your search
@@ -0,0 +1,37 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/v2ray/v2ray-core"
|
||||
"github.com/v2ray/v2ray-core/net/freedom"
|
||||
"github.com/v2ray/v2ray-core/net/socks"
|
||||
)
|
||||
|
||||
func main() {
|
||||
port := uint16(8888)
|
||||
|
||||
uuid := "2418d087-648d-4990-86e8-19dca1d006d3"
|
||||
vid, err := core.UUIDToVID(uuid)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
config := core.VConfig{
|
||||
port,
|
||||
[]core.VUser{core.VUser{vid}},
|
||||
"",
|
||||
[]core.VNext{}}
|
||||
|
||||
vpoint, err := core.NewVPoint(&config, socks.SocksServerFactory{}, freedom.FreedomFactory{})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = vpoint.Start()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
finish := make(chan bool)
|
||||
<-finish
|
||||
}
|
||||
Reference in new issue
Block a user