Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitter module not working with Proxy #1335

Closed
Mondlicht81 opened this issue Nov 24, 2017 · 6 comments
Closed

Twitter module not working with Proxy #1335

Mondlicht81 opened this issue Nov 24, 2017 · 6 comments
Assignees
Labels
Milestone

Comments

@Mondlicht81
Copy link

Hi all,

I have some issues with the Twitter module.
The Twitter module works fine with direct connection to the internet. I configured both API key and secret, and I can get feeds.

BUT: as soon as I configure a proxy, it stops working.
Through Wireshark, I found out that the HTTP POST request to https://api.twitter.com/oauth2/token seems to be malformed in case it has to go via a proxy. Wireshark doesn't decode the HTTP CONNECT (HTTPS Tunneling) request, and apparently also the proxy server doesn't like it.
I tried to modify the curl options in /var/www/cms/lib/Widget/TwitterBase.php, but without success.

The rest of the connections via the proxy are fine. Other HTTP CONNECT requests are working, and also Wireshark displays them correctly.

Does anyone of you have an idea what could be wrong here? Is the problem the self-written header in /var/www/cms/lib/Widget/TwitterBase.php lines 48-52? Does it have to look differently in case of proxy connections?

Thanks for your help.

@Mondlicht81
Copy link
Author

Seems this didn't get too much attention. Does anyone have any suggestion where to look for a solution?

@dasgarner
Copy link
Member

Sorry, I didn't even see this - please can you open a topic on community where someone will verify the issue and then target this to a release for investigation/fix.

@Mondlicht81
Copy link
Author

@alexharrington
Copy link
Member

I’ve setup a local squid proxy.

CMS is configured as follows:

Proxy Host: tcp://ip.adddress
Proxy Port: 3128

RSS feeds are downloaded correctly via the proxy, however as you suggest Twitter API calls fail. CMS logs Unable to reach twitter api.

The proxy shows nothing in its log. It does look like there’s an issue there. I will target your original bug so that it’s looked at in a future release.

@alexharrington alexharrington added this to the 1.8.8 milestone Feb 27, 2018
@dasgarner
Copy link
Member

I have a suspicion that the new PHP7 containers aren't providing cURL in a form that Guzzle will use and therefore requests are being made with fsock.

This impacts the proxy configuration because it expected tcp:// (we've been using http:// for years with no issues).

Also Twitter as a module does not use Guzzle at all - it forms its own request with cURL.

@alexharrington
Copy link
Member

It does appear to work on 1.8.3, with proxy specified as http://, so I suspect that is the root issue

@dasgarner dasgarner self-assigned this Mar 6, 2018
dasgarner added a commit to dasgarner/xibo-cms that referenced this issue Mar 6, 2018
…actory and fixed Ticker (cannot be treated as a stream). Tested against local squid proxy xibosignage/xibo#1335

Made sure new widget caching can be cache dropped from modules.
Added a helper shell script to run composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants