Mailing List Archive

Network Proxy
I refer to this comment from a user

https://code.mythtv.org/trac/ticket/10633#comment:33

He is having a problem because he has an http proxy in his environment
and mythtv is trying to use that for listening. I looked into the code
and it is looking for an environment variable and setting a default
proxy based on http_proxy

https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythbase/mythmiscutil.cpp#L830

Then when it is listening it is using that. It seems to me that using an
http proxy for listening is incorrect. I would have thought that QT
would have ignored it but it is caused an unsupported operation error on
one of the ports in his setup (see the log in the above ticket). It is
not clear why only one of the ports is affected, but evidently removing
the http_proxy environment variable solves it.

https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythbase/serverpool.cpp#L416

I think we can just remove that "server->setProxy(m_proxy);" line in
the listen code, but I am not sure why it is there and whether it is
valid. I would think we should only use a proxy when accessing http
services, not when listening.

Does anybody have any recommendations on this?

Peter
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Network Proxy [ In reply to ]
On Mon, Aug 7, 2017 at 4:43 PM, Peter Bennett <pgbennett@comcast.net> wrote:

> Does anybody have any recommendations on this?

No recommendations, but some (possible) history....

caveat emptor: I am sure I am misremembering the
various discussions, and I have not really looked at
any of the MyhthTV socket code recently, and
certainly have not tried to understand it well.

(A long time ago, with a Qt variant far far away) there
were various discussions regarding proxies. I believe
Qt updated a bunch of proxy stuff around the 4.8.x
period, so I suspect some of *our* (where I mean
*your*) code may exist to deal with pre 4.8 issues
and are no longer relevant (or at least replaced with
new and different opportunities) now that the project
has moved to (at least) Qt 5.2.

It was further complicated because, as I recall, Qt
automagically used proxies in some cases (and that
magic did not always do what everyone would want).
And there are always the special cases where you
need more flexibility regarding proxies (and yes, that
could include reverse proxies for listeners).

FWIW, if you explicitly want to not use a proxy, I think
you may want to set it explicitly to avoid defaults:
server->setProxy(QNetworkProxy::NoProxy)

And the solution for some is to explicitly unset the
http_proxy environment variable in their MythTV
service file, or properly configuring the no_proxy
env variable, or engineering their network according
to industry best practices using transparent proxies
at their upstream gateways.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org