Closed aburnheimer closed 11 years ago
Doing as voloko suggested, and restoring the full url as bgreenlee suggested did not result in anymore success here:
[aburnheimer@hostname ~]$ ./Listen_in_on_Campfire_room.rb
options: {:port=>443, :method=>"GET", :content_type=>"application/x-www-form-ur
lencoded", :auto_reconnect=>true, :content=>"", :timeout=>0, :params=>{}, :user
_agent=>"TwitterStream", :host=>"proxy_ip removed", :proxy=>"http://...proxy_ho
stname removed...:3128", :auth=>"123467890abcdef123467890abcdef123456789:X", :s
sl=>true, :oauth=>{}, :path=>"/room/123456/live.json", :filters=>[]}
send_request: ["GET https://proxy_ip removed:443/room/123456/live.json HTTP/1.1
", "Host: streaming.campfirenow.com", "Accept: */*", "User-Agent: TwitterStream
", "Authorization: Basic ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZAB
CD", "\r\n"]
nor here - note the port number is present in the Host header for this attempt:
[aburnheimer@hostname ~]$ ./Listen_in_on_Campfire_room.rb
options: {:port=>443, :method=>"GET", :content_type=>"application/x-www-form-ur
lencoded", :auto_reconnect=>true, :content=>"", :timeout=>0, :params=>{}, :user
_agent=>"TwitterStream", :host=>"proxy_ip removed", :proxy=>"http://...proxy_ho
stname removed...:3128", :auth=>"123467890abcdef123467890abcdef123456789:X", :s
sl=>true, :oauth=>{}, :path=>"/room/123456/live.json", :filters=>[]}
send_request: ["GET https://proxy_ip removed:443/room/123456/live.json HTTP/1.1
", "Host: streaming.campfirenow.com:443", "Accept: */*", "User-Agent: TwitterSt
ream", "Authorization: Basic ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX
YZABCD", "\r\n"]
Found it... Have to have the options look as such, just as voloko suggested way-back:
options: {:auth=>"123467890abcdef123467890abcdef123456789:X", :method=>"GET",
:auto_reconnect=>true, :content=>"", :content_type=>"application/x-www-form-url
encoded", :user_agent=>"TwitterStream", :host=>"proxy_ip removed", :params=>{}, :t
imeout=>0, :proxy=>nil, :port=>3128, :oauth=>{}, :path=>"https://streaming.camp
firenow.com:443/room/123456/live.json", :ssl=>false, :filters=>[]}
send_request: ["GET https://streaming.campfirenow.com:443/room/123456/live.json
HTTP/1.1", "Host: streaming.campfirenow.com", "Accept: */*", "User-Agent: Twit
m", "Authorization: Basic ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZA
BCD", "\r\n"]
I'll wrap this into a pull request, or something similar later this evening.
I'm having a problem going through Squid despite the changes bgreenlee suggested 3 years ago in Issue https://github.com/voloko/twitter-stream/issues/2.
Using Twitter::JSONStream as shown at https://gist.github.com/4179836.js?file=Listen_in_on_Campfire_room.rb , I get the following results - with a little bit of annotation sprinkled in at bottom of JSONStream#send_request, and temporarily backing out the "full url" fix bgreenlee suggested, please read on:
Meanwhile, using curl, I can generate the exact same headers, and it works...
Even just advice on where or how to investigate further would be appreciated. I've been annotating twitter-stream-0.1.16 and eventmachine-1.0.0 to try and determine where these may be diverting from whatever curl is doing right. Unfortunately, I haven't found any clues after lots of trials and errors.
My next move is to switch to the pure_ruby of eventmachine, but the initial resistance I found with that suggested to me to maybe reach out for help first.