1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 17:46:58 -05:00
v2fly/release/server/socks/main.go

38 lines
627 B
Go
Raw Normal View History

2015-09-11 08:12:09 -04:00
package main
import (
2015-09-11 08:12:26 -04:00
"log"
"github.com/v2ray/v2ray-core"
"github.com/v2ray/v2ray-core/net/freedom"
"github.com/v2ray/v2ray-core/net/socks"
2015-09-11 08:12:09 -04:00
)
func main() {
2015-09-11 08:12:26 -04:00
port := uint16(8888)
uuid := "2418d087-648d-4990-86e8-19dca1d006d3"
2015-09-11 08:12:09 -04:00
vid, err := core.UUIDToVID(uuid)
2015-09-11 08:12:26 -04:00
if err != nil {
log.Fatal(err)
}
2015-09-11 08:12:09 -04:00
config := core.VConfig{
port,
[]core.VUser{core.VUser{vid}},
"",
[]core.VNext{}}
vpoint, err := core.NewVPoint(&config, socks.SocksServerFactory{}, freedom.FreedomFactory{})
2015-09-11 08:12:26 -04:00
if err != nil {
log.Fatal(err)
}
err = vpoint.Start()
if err != nil {
log.Fatal(err)
}
finish := make(chan bool)
<-finish
2015-09-11 08:12:09 -04:00
}