Signed-off-by: arraykeys@gmail.com <arraykeys@gmail.com>

This commit is contained in:
arraykeys@gmail.com
2017-10-30 14:20:13 +08:00
parent 1241b74562
commit e2f0fe71f4
5 changed files with 15 additions and 5 deletions

View File

@ -1,4 +1,7 @@
proxy更新日志 proxy更新日志
v3.5
1.优化了kcp参数,速度有所提升.
v3.4 v3.4
1.tcp代理增加了kcp协议传输数据. 1.tcp代理增加了kcp协议传输数据.
2.优化了死循环检查,增加了添加本地IP参数,当VPS在nat设备后面, 2.优化了死循环检查,增加了添加本地IP参数,当VPS在nat设备后面,

View File

@ -9,7 +9,7 @@ import (
"syscall" "syscall"
) )
const APP_VERSION = "3.4" const APP_VERSION = "3.5"
func main() { func main() {
err := initConfig() err := initConfig()

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
VER="3.4" VER="3.5"
RELEASE="release-${VER}" RELEASE="release-${VER}"
rm -rf .cert rm -rf .cert
mkdir .cert mkdir .cert

View File

@ -72,7 +72,7 @@ func (s *TunnelClient) InitHeartbeatDeamon() {
log.Printf("heartbeat connection read err: %s", err) log.Printf("heartbeat connection read err: %s", err)
break break
} else { } else {
log.Printf("heartbeat from bridge") //log.Printf("heartbeat from bridge")
} }
} }
close(readDie) close(readDie)

View File

@ -119,9 +119,16 @@ func ConnectHost(hostAndPort string, timeout int) (conn net.Conn, err error) {
return return
} }
func ConnectKCPHost(hostAndPort, method, key string) (conn net.Conn, err error) { func ConnectKCPHost(hostAndPort, method, key string) (conn net.Conn, err error) {
conn, err = kcp.DialWithOptions(hostAndPort, GetKCPBlock(method, key), 10, 3) kcpconn, err := kcp.DialWithOptions(hostAndPort, GetKCPBlock(method, key), 10, 3)
if err != nil {
return return
} }
kcpconn.SetNoDelay(1, 40, 0, 1)
kcpconn.SetWindowSize(128, 512)
kcpconn.SetMtu(1400)
kcpconn.SetACKNoDelay(false)
return kcpconn, err
}
func ListenTls(ip string, port int, certBytes, keyBytes []byte) (ln *net.Listener, err error) { func ListenTls(ip string, port int, certBytes, keyBytes []byte) (ln *net.Listener, err error) {
var cert tls.Certificate var cert tls.Certificate
cert, err = tls.X509KeyPair(certBytes, keyBytes) cert, err = tls.X509KeyPair(certBytes, keyBytes)