Re: Proxy support over AF_UNIX



On Sat, Jan 26, 2013 at 15:14:54 -0500, Dan Winship wrote:
So, once all this stuff lands (soon),

It appears as though the patch to use GProxyResolver for all proxy
handling hasn't landed (the patch from the bug still applies). Will it
land before 2.42.0 is released?

the only part that you'll need to implement yourself is a GProxy
implementation that does your connect-via-unix-socket thing. Then
you'd create a GSimpleProxyResolver, tell it to always return
"unix:/my/socket/path" (or whatever kind of URI you use) as the proxy
URI, and then tell the SoupSession to use that proxy resolver. And
then it should just work...

I'm looking at this again, trying to get a GProxy implementation
working, but I seem to be lost in some black magic that GIO does with
little to no documentation (that I can find). So far, I have a GProxy
subclass which, based off of GSocks4aProxy, needs to do pretty much
nothing in GProxy::connect other than return the given GIOStream.
However, I have no idea where I need to implement the socket/connect
calls to create the GIOStream which gets passed to it (based on my
reading of the docs which seems to state that the GProxy::connect
GIOStream which is passed in is already connected to the proxy).

For that matter, I have no idea how the GProxy subclass I've made gets
into GProxyResolver. It appears as though it'll happen magically with
g_io_extension_point_implement, but I also don't know where my GProxy
subclass could say "yes, I implement that; use me".

Looking at where g_proxy_connect is called, it appears as though I need
to actually replace the GSocket, but that's kind of a stab in the dark.
This code is not the easiest to grok what with the docs being bare bones
and examples being non-existent AFAICT.

--Ben


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]