Forum
[IDEA] proxy server with .pac - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Kodi (/forum-18.html)
+--- Thread: [IDEA] proxy server with .pac (/thread-266.html)



proxy server with .pac - p4trykx - 15th Jan, 2013 11:34 AM

Hello
There is a nice Firefox addon called Media Hint which basically usese special rules for proxy to fool Hulu or Pandora that you are in the USA.
The trick is to use proxy just for those reqests that check the geolocation and the main traffic does not use proxy. This is much faster.
Unfortunatley XBMC does not support using .pac file
http://en.wikipedia.org/wiki/Proxy_auto-config

I wonder if there is a way to set up some proxy server on xbian which will handle the rules.


RE: proxy server with .pac - Koenkk - 25th Jan, 2013 11:44 PM

You could try SQUID. http://www.skullbox.net/squid.php


RE: proxy server with .pac - psyLord - 12th Nov, 2014 11:34 PM

Does someone tried SQUID? And does it works for this purpose?

I'm also searching for a solution to use a pac file in XBMC or for the whole system for only specific connections. I want to avoid a system wide proxy for all connections. Does someone has a solution for this?

(My idea is to use the pac file that is working fine with firefox to unblock Grooveshark. Maybe there is another way to use a grooveshark plugin in restricted countries?)


RE: proxy server with .pac - mk01 - 15th Nov, 2014 10:51 PM

@psyLord

SQUID works with XBMC, although on most video streaming sites you will find that moving through the video (skip +30s, 10min) is no longer working.

back in time when I was trying that I found that this wasn't misconfiguration, but simply the way how that works (and SQUID in between). but I also found some special enhancements to squid (.conf and scripts) to handle full media experience, but never tried.


RE: proxy server with .pac - psyLord - 24th Nov, 2014 08:31 PM

Thanks for your answer mk01.

Then I will look into SQUID and will try to configure it.


RE: proxy server with .pac - mk01 - 5th Dec, 2014 10:26 AM

if you configure squid to act as transparent proxy too, you can handle .pac at squid (and zero config at clients).

now when I think retrospectively, that kind of squid usage (as transparent proxy) is creating that additional load on configuration (for media webs proxying).

different approach:
https://code.google.com/p/libproxy/

very small and VERY easy to use in existing code. I will check current XBMC calls (to proxy) whether it is under 1h to implement. then we can release a patch which would make XBMC understand .pac file as "proxy server".


RE: proxy server with .pac - psyLord - 8th Dec, 2014 08:58 PM

(5th Dec, 2014 10:26 AM)mk01 Wrote:  if you configure squid to act as transparent proxy too, you can handle .pac at squid (and zero config at clients).

now when I think retrospectively, that kind of squid usage (as transparent proxy) is creating that additional load on configuration (for media webs proxying).

different approach:
https://code.google.com/p/libproxy/

very small and VERY easy to use in existing code. I will check current XBMC calls (to proxy) whether it is under 1h to implement. then we can release a patch which would make XBMC understand .pac file as "proxy server".

That would be nice. I hope the implementing time will be under 1h and you can manage the it Smile


RE: proxy server with .pac - mk01 - 16th Dec, 2014 02:58 PM

@psyLord

I realised libproxy package is part of debian main apt so just do
apt-get install libproxy libproxy-plugin*

currently I found not the xbmc source biggest problem - this I have done already. but I'm not able to succeed with libproxy as is. by default it provides the usual auto proxy discovery - to find .pac somewhere on the network. my macs (safari) work well with dns record "wpad" directing to http where is /wpad.dat file.

but libproxy seems to be ... not doing the job. in docs there is also notice that via mozjs (java script parser/engine) it is able to understand and read even local .pac files (file://) but I'm unable to find any reference HOW to specify it.

can you please check? no programming there, if you install libproxy-tools you will have "proxy" binary at hand which according to man should work like:

echo http://www.google.com | proxy

but I see in web logs wpad.dat is not accessed, in dns logs that wpad name is not checked so proxy returns always direct://.

anyhow the patch is here, currently it changes xbmc way of resolving (getting http) like this:
1) first autoproxy resolving is started via libproxy
2) if proxys are returned - XBMC internal setting is overwritten
3) otherwise that local setting is used
4) otherwise direct

the code alone works (as currently libproxy returns always direct://), so if you make libproxy work as it should it is done.
https://github.com/xbianonpi/xbian-package-xbmc/blob/master/patches/libproxy.patch


RE: proxy server with .pac - psyLord - 16th Dec, 2014 06:35 PM

@mk01: I will check it when I'm back home after work.


RE: proxy server with .pac - mk01 - 16th Dec, 2014 09:05 PM

@psyLord

no stress. ... take your time.


RE: proxy server with .pac - mk01 - 21st Dec, 2014 06:16 AM

@psyLord

got it working. for now with .pac provided via http, but significant progress.
so I can start checking the xbmc implementation.