瀏覽代碼

Use the same protocol as client

tags/0.9
9seconds 8 年之前
父節點
當前提交
53ef81a4fc
共有 1 個檔案被更改,包括 5 行新增0 行删除
  1. 5
    0
      client/middle.go

+ 5
- 0
client/middle.go 查看文件

@@ -21,5 +21,10 @@ func MiddleInit(conn net.Conn, conf *config.Config) (*mtproto.ConnectionOpts, wr
21 21
 		newConn = mtwrappers.NewIntermediateRWC(newConn, opts)
22 22
 	}
23 23
 
24
+	opts.ConnectionProto = mtproto.ConnectionProtocolIPv4
25
+	if conn.LocalAddr().(*net.TCPAddr).IP.To4() == nil {
26
+		opts.ConnectionProto = mtproto.ConnectionProtocolIPv6
27
+	}
28
+
24 29
 	return opts, newConn, nil
25 30
 }

Loading…
取消
儲存