Esempio n. 1
0
func run(wd string, port int) error {
	userlist, err := NewUserList(wd)
	if err != nil {
		return err
	}
	acceptor := moses.NewSOCK5Acceptor(userlist)
	srv := moses.NewServer(acceptor, &moses.DirectConnector{})
	if err := srv.Start(uint16(port)); err != nil {
		return err
	}
	srv.Serve()
	return nil
}
Esempio n. 2
0
func run(param *Param) error {
	connector := &moses.SOCKS5Connector{
		User:     param.User,
		Password: param.Password,
		Host:     param.ProxyHost,
		Port:     param.ProxyPort,
	}
	//acceptor := moses.NewSOCK5Acceptor(nil)
	acceptor := moses.SOCKS4Acceptor{}
	srv := moses.NewServer(acceptor, connector)
	if err := srv.Start(param.LocalPort); err != nil {
		return err
	}
	srv.Serve()
	return nil
}