I am trying to connect to the twitter stream api to fetch tweets in realtime. This piece of code was working till 5-6 ago. Suddenly I've started receiving 401 all the time. Strangely this is both happening in my local machine and on our production server which is located in cloud, so I think this is not a network related issue.

Here is the code:

```
l = StdOutListener()

auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
auth.callback = 'https://localhost' #no effect commented/uncommented
stream = Stream(auth, l)
stream.filter(track=['twitter'], languages=["es"])

```

So far I've tried the following:

1. Generating new consumer key, consumer secret, access token and access token secret. I've used 4 different set of keys which was working previously.
2. Created a fresh new app from apps.twitter.com. Filled the callback url as some users reported that 401 "Authorization Required" is related with the callback URL field missing in the application page of twitter.
3. Synced my clock with an ntp server, both on my local and on production server. My clock is not off.
4. My application have the correct privileges and I received access token and secret after the configuration.

Here is the request:

```
'Content-Length': '22'
'Content-Type': 'application/x-www-form-urlencoded'
'Authorization': 'OAuth oauth_nonce="161484371946745487981492681844"
    oauth_timestamp="1492681844"
    oauth_version="1.0"
    oauth_signature_method="HMAC-SHA1"
    oauth_consumer_key="<oauth_consumer_key>"
    oauth_token="<oauth_token>"
    oauth_signature="tphQqFWaBvEo2byjZ%2BRqNAM30I0%3D"'
Method: 'POST'
URL: 'https://stream.twitter.com/1.1/statuses/filter.json?delimited=length'

```

Any help would be appreciated on why I am getting a 401 Unauthorized "Need Authorization" response.

Edit: I've also tried using Twython and I got the same response back from twitter.

Thanks