Dial connects to a address with a Cipher address should be in the form of host:port.
(network, address string, cipher *Cipher)
| 58 | // Dial connects to a address with a Cipher |
| 59 | // address should be in the form of host:port. |
| 60 | func Dial(network, address string, cipher *Cipher) (c *CryptoConn, err error) { |
| 61 | conn, err := net.DialTimeout(network, address, conf.TCPDialTimeout) |
| 62 | if err != nil { |
| 63 | log.WithField("addr", address).WithError(err).Error("connect failed") |
| 64 | return |
| 65 | } |
| 66 | c = NewConn(conn, cipher) |
| 67 | return |
| 68 | } |
| 69 | |
| 70 | // Read iv and Encrypted data. |
| 71 | func (c *CryptoConn) Read(b []byte) (n int, err error) { |