Streaming API Fails on Staging Server



Hi all,

We’re using the em-twitter Ruby gem to monitor tweets. The script appears to be working fine on my dev machine. However when deploying to a staging server, the script appears to have an “unauthorized error”. I know that the credentials are correct, because I can connect to the non-streaming API on the staging server without any difficulty.

The script is only receiving one tweet per minute or so, it’s not a heavy connection.

I tried on my dev machine with a proxy for the event machine and the same unauthorized error was presented.

I cannot seem to find any documentation for limitations around this particular problem, any thoughts/suggestions would be appreciated.


If you’re using the same keys then you can only have a single connection. However, I’d generally expect the behaviour to be that the first connection would be disconnected, rather than getting an unauthorized error. I’d suggest checking the time on the staging server, because OAuth has a time component to the authentication algorithm.


My note about using the proxy on my dev machine should remove the element of time being an issue, as it’s using the same system clock. I am using ntpd on the staging server, so the time should be correct there too.

I am only running the open connection on one machine at a time. I’ve taken a snapshot of the headers: