librelist archives

« back to archive

Re: redsocks: "better buffer support"

Re: redsocks: "better buffer support"

From:
Moroni Granja
Date:
2011-12-09 @ 11:45
Leonid,
Here is the redsocks.conf:

base {
log_debug = on;
log_info = on;
log =
"file:/data/data/com.mgranja.autoproxy/files/../app_logs/redsocks.log";
daemon = on;
redirector = iptables;
}


redsocks {
 local_ip = 0.0.0.0;
 local_port = 8123;
 ip = 10.10.111.252;
 port = 8080;
 type = http-relay;
}
redsocks {
 local_ip = 0.0.0.0;
 local_port = 8124;
 ip = 10.10.111.252;
 port = 8080;
 type = http-connect;
}

as for the iptables-save, there is no iptables configured, I'm just
pointing my browser's proxy config to localhost:8123.

Regards,
Moroni Granja



2011/12/9 Leonid Evdokimov <leon@darkk.net.ru>

> On Wed, Dec 7, 2011 at 22:20, Moroni Granja <moronigranja@gmail.com>
> wrote:
> > Hey darkk, I have a question for you. I'm trying to specify redsocks as a
> > proxy. That is, I want to specify the proxy settings as localhost:8123,
> and
> > have redsocks listening in that port and redirecting all incoming
> connection
> > to the proxy that is configured there. It's not working for HTTP
> proxies, I
> > haven't tested for socks. Is there a way to do that which I'm
> overlooking,
> > or should I look to implement this?
>
> First, you can forward all further questions to mailing list:
> redsocks@librelist.com
>
> Redsocks was written with exactly this use-case in mind, so, please,
> show me iptables-save output and redsocsk.conf to be sure you've
> configured it correctly.
>
> And, again, it'll be nice to continue discussion in mailing list (just
> to have indexable archives).
>
> --
> WBRBW, Leonid Evdokimov
> xmpp:leon@darkk.net.ru && http://darkk.net.ru
> tel:+79816800702 && tel:+79050965222
>

Re: redsocks: "better buffer support"

From:
Moroni Granja
Date:
2011-12-09 @ 13:29
Hi all, I think I'd better explain what I want with this. My goal is to
have a phone or laptop always configured to access the proxy at
localhost:8123, and have a program that would change the configuration
files for redsocks and restart it when certain networks were detected. That
way I wouldn't have to go to the settings and change the proxy everytime
I'm on a network which required proxy.

Here are my thoughts on the issues:
As far as plain http goes, it should be an easy patch if there isn't an
option already.

I think redsocks is expecting something like this:

GET / HTTP/1.1
Host: www.google.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2 (KHTML, like
Gecko) Chrome/15.0.874.121 Safari/535.2
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

But it's getting this:

GET http://www.google.com/ HTTP/1.1
Host: www.google.com
Proxy-Connection: keep-alive
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2 (KHTML, like
Gecko) Chrome/15.0.874.121 Safari/535.2
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

I'm not sure about https, though, or other connections
through http-connect. I expect redsocks would open the connection with
CONNECT mail.google.com:443 HTTP/1.1
and then just forward the data, whereas if I configured it as a proxy, the
connect line would be added twice. It's probably more complicated than
that, though.
Then there would be the problem of needing to use a single port, instead of
8123 for http-relay and 8124 for http-connect, but that should be simple
too.


2011/12/9 Moroni Granja <moronigranja@gmail.com>

> Leonid,
> Here is the redsocks.conf:
>
> base {
> log_debug = on;
> log_info = on;
> log =
> "file:/data/data/com.mgranja.autoproxy/files/../app_logs/redsocks.log";
> daemon = on;
> redirector = iptables;
> }
>
>
> redsocks {
>  local_ip = 0.0.0.0;
>  local_port = 8123;
>  ip = 10.10.111.252;
>  port = 8080;
>  type = http-relay;
> }
> redsocks {
>  local_ip = 0.0.0.0;
>  local_port = 8124;
>  ip = 10.10.111.252;
>  port = 8080;
>  type = http-connect;
> }
>
> as for the iptables-save, there is no iptables configured, I'm just
> pointing my browser's proxy config to localhost:8123.
>
> Regards,
> Moroni Granja
>
>
>
> 2011/12/9 Leonid Evdokimov <leon@darkk.net.ru>
>
>> On Wed, Dec 7, 2011 at 22:20, Moroni Granja <moronigranja@gmail.com>
>> wrote:
>> > Hey darkk, I have a question for you. I'm trying to specify redsocks as
>> a
>> > proxy. That is, I want to specify the proxy settings as localhost:8123,
>> and
>> > have redsocks listening in that port and redirecting all incoming
>> connection
>> > to the proxy that is configured there. It's not working for HTTP
>> proxies, I
>> > haven't tested for socks. Is there a way to do that which I'm
>> overlooking,
>> > or should I look to implement this?
>>
>> First, you can forward all further questions to mailing list:
>> redsocks@librelist.com
>>
>> Redsocks was written with exactly this use-case in mind, so, please,
>> show me iptables-save output and redsocsk.conf to be sure you've
>> configured it correctly.
>>
>> And, again, it'll be nice to continue discussion in mailing list (just
>> to have indexable archives).
>>
>> --
>> WBRBW, Leonid Evdokimov
>> xmpp:leon@darkk.net.ru && http://darkk.net.ru
>> tel:+79816800702 && tel:+79050965222
>>
>
>