|
@ -43,7 +43,7 @@ struct connecting_socks { |
|
|
|
|
|
|
|
|
static const char* socks5strerror(const tal_t *ctx, u8 code) |
|
|
static const char* socks5strerror(const tal_t *ctx, u8 code) |
|
|
{ |
|
|
{ |
|
|
// Error codes defined in https://tools.ietf.org/html/rfc1928#section-6
|
|
|
/* Error codes defined in https://tools.ietf.org/html/rfc1928#section-6 */ |
|
|
switch (code) { |
|
|
switch (code) { |
|
|
case 0: |
|
|
case 0: |
|
|
return tal_strdup(ctx, "success"); |
|
|
return tal_strdup(ctx, "success"); |
|
@ -134,8 +134,9 @@ static struct io_plan *io_tor_connect_after_resp_to_connect(struct io_conn |
|
|
status_io(LOG_IO_IN, NULL, "proxy", connect->buffer, 2); |
|
|
status_io(LOG_IO_IN, NULL, "proxy", connect->buffer, 2); |
|
|
|
|
|
|
|
|
if (connect->buffer[1] == SOCKS_ERROR) { |
|
|
if (connect->buffer[1] == SOCKS_ERROR) { |
|
|
// The Tor socks5 server did not like any of our authentication
|
|
|
/* The Tor socks5 server did not like any of our authentication
|
|
|
// methods and we provided only "no auth".
|
|
|
* methods and we provided only "no auth". |
|
|
|
|
|
*/ |
|
|
status_debug("Connected out for %s error: authentication required", |
|
|
status_debug("Connected out for %s error: authentication required", |
|
|
connect->host); |
|
|
connect->host); |
|
|
return io_close(conn); |
|
|
return io_close(conn); |
|
@ -187,7 +188,7 @@ static struct io_plan *io_tor_connect_do_req(struct io_conn *conn, |
|
|
&io_tor_connect_after_req_to_connect, connect); |
|
|
&io_tor_connect_after_req_to_connect, connect); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// called when we want to connect to TOR SOCKS5
|
|
|
/* called when we want to connect to TOR SOCKS5 */ |
|
|
struct io_plan *io_tor_connect(struct io_conn *conn, |
|
|
struct io_plan *io_tor_connect(struct io_conn *conn, |
|
|
const struct addrinfo *tor_proxyaddr, |
|
|
const struct addrinfo *tor_proxyaddr, |
|
|
const char *host, u16 port, |
|
|
const char *host, u16 port, |
|
|