Hi,

I rewrote a patch I did last year about supporting manual proxy configuration 
into pacrunner.
Instead of directly implementing it into the core, I did a tool which can be 
used to test the proposal directly.

The current proposal is as follow:

- it handles only well known protocols: http, https, ftp, socks4 and socks5
If necessary, it will be trivial to add support for any kind of protocols. I 
already have an idea for that.

- it returns only 1 result, though here again it would be trivial to support a 
list as a result

- uri parsing is done without regex. (small detail though: if an IP address is 
given, its sanity is not checked)

- server list follows such uri: 
<protocol://><<login>:<pass>@><hostname><:port></>  where hostname is the only 
mandatory element
Note: <<login>:<pass>@> is parsed but ignored, is it relevant to support it or 
not: let's discuss about that.

- exclusion rule list follows such uri: <protocol://><rule> where rule is:
        - <*>keyword -> all hostname ending with keyword ('*' is optional)
        - keyword*   -> all hostname starting with keyword
        - *keyword*  -> all hostname made with keyword

        Note: keyword might be empty. Then, if the protocol is given: it will 
excludes all url with that protocol. 
                '*' is wrong: you cannot exclude everything -> what's the point 
of having a proxy configuration then?

- how servers apply: there is 2 ways. Either you have a generic proxy or 
protocol based ones.
They do not apply together: it's either one or the other. So when you set a 
proxy server without a protocol, it will 
set a generic proxy server and this will be the only way. (generic is shown as 
protocol 'ALL')
This could be changed to a mixed way, trivial to change also

- how excludes apply: there is one way.
If a generic exclusion rule is present it will be tested in priority, and/or 
then the other rules will be tested.

Note: if given url is for protocol ftp, and there is no exclusion rule for that 
protocol, all other protocol rules
will not of course be tested.

- output: DIRECT, or a server (its hostname and, if present, its port).

So, I hope it's clear enough. If not, let's discuss about that. Anyway as a 
test you can run: 

./manual -s 
"http://tudubu.com:478,ftp://narrow.org:12345/,http://*tchoup,http://kado/,http://non.au/tadaaa,socks4://[fe80::216:d3ff:febb:8bd7]:7849";
 
-e "*com,http://*,*a*,bla,bli*"; -t "ftp://truca.com,ftp://truc.org,nab";

If the tested url is wrong, it will return DIRECT. Imho, it's not up to 
pacrunner to know if the given url is well written or not. But if necessary 
it can be changed as well.

Note also: it currently does not handle duplicates. If duplicates are given, it 
will creates duplicates (server or exclusion). This can be also 
managed later in the core too when moving the code there.

Please review,

Tomasz Bursztyka (1):
  tools: added a tool called manual

 Makefile.am    |    5 +-
 tools/manual.c |  732 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 736 insertions(+), 1 deletions(-)
 create mode 100644 tools/manual.c

-- 
1.7.3.4


_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to