-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
490 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,34 @@ | ||
package client | ||
|
||
import "github.com/asche910/flynet/util" | ||
import "github.com/asche910/flynet/fly" | ||
|
||
type FlyClient struct { | ||
Mode int | ||
localhost string | ||
Ports []string // ports[0] stands for the listening port; others are for reserve | ||
Method string | ||
Password string | ||
protocol string // tcp or udp protocol | ||
ServerAddr string | ||
|
||
} | ||
|
||
func (client *FlyClient) LocalSocks5Proxy(port string) { | ||
util.StartSocks5(port) | ||
fly.StartSocks5(port) | ||
} | ||
|
||
func (client *FlyClient) LocalHttpProxy(port string) { | ||
util.StartHttp(port) | ||
fly.StartHttp(port) | ||
} | ||
|
||
func (client *FlyClient) Socks5ProxyForTCP(localPort, serverAddr string) { | ||
util.Socks5ForClientByTCP(localPort, serverAddr) | ||
func (client *FlyClient) Socks5ProxyForTCP(localPort, serverAddr, method, key string) { | ||
fly.Socks5ForClientByTCP(localPort, serverAddr, method, key) | ||
} | ||
|
||
func (client *FlyClient) Socks5ProxyForUDP(localPort, serverAddr string) { | ||
util.Socks5ForClientByUDP(localPort, serverAddr) | ||
fly.Socks5ForClientByUDP(localPort, serverAddr) | ||
} | ||
|
||
func (client *FlyClient) PortForward(laborPort, serverAddr string) { | ||
util.PortForwardForClient(laborPort, serverAddr) | ||
fly.PortForwardForClient(laborPort, serverAddr) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.