called when we want to connect to TOR SOCKS5 */
| 227 | |
| 228 | /* called when we want to connect to TOR SOCKS5 */ |
| 229 | struct io_plan *io_tor_connect(struct io_conn *conn, |
| 230 | const struct addrinfo *tor_proxyaddr, |
| 231 | const char *host, u16 port, |
| 232 | struct connecting *connect) |
| 233 | { |
| 234 | struct connecting_socks *connect_tor = tal(connect, |
| 235 | struct connecting_socks); |
| 236 | |
| 237 | connect_tor->port = htons(port); |
| 238 | connect_tor->host = tal_strdup(connect_tor, host); |
| 239 | connect_tor->connect = connect; |
| 240 | |
| 241 | return io_connect(conn, tor_proxyaddr, |
| 242 | &io_tor_connect_do_req, connect_tor); |
| 243 | } |