Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

redsocks with http-connect does not seem to work on resinOS 2.10.0+ #461

Closed
imrehg opened this issue Apr 2, 2018 · 1 comment · Fixed by balena-os/meta-balena#1049
Closed

Comments

@imrehg
Copy link
Contributor

imrehg commented Apr 2, 2018

Looks like resinOS proxying had a regression, where http-connect of the redsocks.conf works for <=resinOS 2.9.7, but does not work for >=2.10.0 (including the latest 2.12.5). socks5 works for all versions.

On the failing system I see errors like:

Apr 02 09:43:17 e117fb6 redsocks[1212]: 1522662197.346781 info redsocks.c:1243 redsocks_accept_client(...) [192.168.0.72:41046->54.164.253.112:443]: accepted
Apr 02 09:43:17 e117fb6 redsocks[1212]: 1522662197.348122 debug redsocks.c:782 redsocks_shutdown(...) [192.168.0.72:41046->54.164.253.112:443]: shutdown: bufferevent_disable(client, EV_READ)
Apr 02 09:43:18 e117fb6 redsocks[1212]: 1522662198.003146 debug redsocks.c:782 redsocks_shutdown(...) [192.168.0.72:41002->54.164.253.112:443]: shutdown: bufferevent_disable(relay, EV_READ)
...

while on the working system it is something like:

Apr 02 09:43:01 cddc975 redsocks[1003]: 1522662181.875144 info redsocks.c:1243 redsocks_accept_client(...) [192.168.0.35:51336->54.164.253.112:443]: accepted
Apr 02 09:43:01 cddc975 redsocks[1003]: 1522662181.999162 debug redsocks.c:341 redsocks_start_relay(...) [192.168.0.35:51336->54.164.253.112:443]: data relaying started
Apr 02 09:43:02 cddc975 redsocks[1003]: 1522662182.656435 info redsocks.c:671 redsocks_drop_client(...) [192.168.0.35:51336->54.164.253.112:443]: connection closed

The proxy issue blocks the resin-vpn connection, API requests, etc, so the device is not usable with http-connect...

Tested with glider as glider -listen :8080 -verbose, which runs a mixed socks5/http proxy on port 8080, and with redsocks.conf as

base {
log_debug = on;
log_info = on;
log = stderr;
daemon = off;
redirector = iptables;
}

redsocks {
type = http-connect;
ip = hydra.local;
port = 8080;
local_ip = 127.0.0.1;
local_port = 12345;
}

(tested with RPi3 and Qemu images, FYI in Qemu had to use actual IP in the config, as the device see the host by .local address, as it is normal for Qemu)

On both resinOS versions, direct query through the proxy works, e.g. in the host OS: curl -v -x http://hydra.local:8080 https://api.resin.io/ping

On the new system there's this version info.

redsocks.git/release-0.5
Built with libevent-2.1.8-stable
Runs  with libevent-2.1.8-stable

On the older working one:

redsocks.git/release-0.5
Built with libevent-2.0.22-stable
Runs  with libevent-2.0.22-stable

Anything that can be tested for troubleshooting?

Front logo Front conversations

@imrehg
Copy link
Contributor Author

imrehg commented Apr 2, 2018

Might it be this? darkk/redsocks#107

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant