called when we want to connect to TOR SOCKS5 */
| 205 | |
| 206 | /* called when we want to connect to TOR SOCKS5 */ |
| 207 | struct io_plan *io_tor_connect(struct io_conn *conn, |
| 208 | const struct addrinfo *tor_proxyaddr, |
| 209 | const char *host, u16 port, |
| 210 | struct connecting *connect) |
| 211 | { |
| 212 | struct connecting_socks *connect_tor = tal(connect, |
| 213 | struct connecting_socks); |
| 214 | |
| 215 | connect_tor->port = htons(port); |
| 216 | connect_tor->host = tal_strdup(connect_tor, host); |
| 217 | connect_tor->connect = connect; |
| 218 | |
| 219 | return io_connect(conn, tor_proxyaddr, |
| 220 | &io_tor_connect_do_req, connect_tor); |
| 221 | } |