Webrick transparent proxy

I have a simple proxy server.

require 'webrick' 
require 'webrick/httpproxy' 

s = WEBrick::HTTPProxyServer.new(:Port => 8080,
    :RequestCallback => Proc.new{|req,res| puts req.request_line, req.raw_header})

# Shutdown functionality
trap("INT"){s.shutdown}

# run the beast
s.start

      

This, in my opinion, does not affect communication in any way. But some sites no longer work. Especially http://lastfm.de the built-in flash players don't work.

The header looks like a link:

- -> http://ext.last.fm/2.0/?api%5Fsig=aa3e9ac9edf46ceb9a673cb76e61fef4&flashresponse=true&y=1269686332&streaming=true&playlistURL=lastfm%3A%2F%2Fplaylist%2Ftrack%2F42620245&fod=true&sk=ee93ae4f438767bf0183d26478610732&lang=de&api%5Fkey=da6ae1e99462ee22e81ac91ed39b43a4&method=playlist%2Efetch
GET http://play.last.fm/preview/118270350.mp3 HTTP/1.1
Host: play.last.fm
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2) Gecko/20100308 Ubuntu/10.04 (lucid) Firefox/3.6
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Proxy-Connection: keep-alive
Cookie: AnonWSSession=ee93ae4f438767bf0183d26478610732; AnonSession=cb8096e3b0d8ec9f4ffd6497a6d052d9-12bb36d49132e492bb309324d8a4100fc422b3be9c3add15ee90eae3190db5fc
localhost - - [27/Mar/2010:11:38:52 CET] "GET http://www.lastfm.de/log/flashclient/minor/Track_Loading_Fail/Buffering_Timeout HTTP/1.1" 404 7593
- -> http://www.lastfm.de/log/flashclient/minor/Track_Loading_Fail/Buffering_Timeout
localhost - - [27/Mar/2010:11:38:52 CET] "GET http://play.last.fm/preview/118270350.mp3 HTTP/1.1" 302 0

      

I don't know why or what is breaking the connection.

0


a source to share


2 answers


Perhaps this is the crossdomain.xml file on Lastfm.de?

It is installed only to access flash from the following domains:



*.last.fm
*.audioscrobbler.com
87.117.229.54

      

http://lastfm.de/crossdomain.xml

+2


a source


WEBrick is blocking I / O ... This means that it is not capable of transmitting a response. For example, if you go to a YouTube page to see a video, the stream will not be redirected to your browser until the proxy has downloaded all the video quotes. If you want videos to play in your browser during download, you need to look for a non-blocking I / O solution like EventMachine.



+5


a source







All Articles