mirror of
https://github.com/whyvl/wireproxy.git
synced 2025-04-29 19:01:42 +02:00
gofmt
This commit is contained in:
parent
e663f3d412
commit
9f0fe5d20d
1 changed files with 309 additions and 310 deletions
7
main.go
7
main.go
|
@ -226,7 +226,7 @@ persistent_keepalive_interval=%d
|
||||||
preshared_key=%s
|
preshared_key=%s
|
||||||
allowed_ip=0.0.0.0/0`, selfSK, peerPK, peerEndpoint, keepAlive, preSharedKey)
|
allowed_ip=0.0.0.0/0`, selfSK, peerPK, peerEndpoint, keepAlive, preSharedKey)
|
||||||
|
|
||||||
setting := &DeviceSetting{ ipcRequest: request, dns: dns, deviceAddr: &selfEndpoint }
|
setting := &DeviceSetting{ipcRequest: request, dns: dns, deviceAddr: &selfEndpoint}
|
||||||
return setting, nil
|
return setting, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,7 +264,6 @@ func (c CredentialValidator) Valid(username, password string) bool {
|
||||||
return c.username == username && c.password == password
|
return c.username == username && c.password == password
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func connForward(bufSize int, from, to net.Conn) {
|
func connForward(bufSize int, from, to net.Conn) {
|
||||||
buf := make([]byte, bufSize)
|
buf := make([]byte, bufSize)
|
||||||
for {
|
for {
|
||||||
|
@ -347,7 +346,7 @@ func tcpServerRoutine(config map[string]string) (func(*netstack.Net), error) {
|
||||||
return nil, errors.New("listen port out of bound")
|
return nil, errors.New("listen port out of bound")
|
||||||
}
|
}
|
||||||
|
|
||||||
addr := &net.TCPAddr{Port : int(listenPort)}
|
addr := &net.TCPAddr{Port: int(listenPort)}
|
||||||
|
|
||||||
target, ok := config["target"]
|
target, ok := config["target"]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -436,5 +435,5 @@ func main() {
|
||||||
go netRoutine(tnet)
|
go netRoutine(tnet)
|
||||||
}
|
}
|
||||||
|
|
||||||
select{} // sleep eternally
|
select {} // sleep eternally
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue