2010-03-27 4 views
0

절대 간단한 프록시를 실행했습니다.Webrick transparent proxy

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 

내 마음에 어떤 식 으로든 통신에 영향을 미치지 않아야합니다. 그러나 일부 사이트는 더 이상 작동하지 않습니다. 특히 http://lastfm.de의 임베디드 플래시 플레이어가 작동하지 않습니다.

- -> 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 

나는 몇 가지 힌트 이유 또는 무엇 통신 방해를이 nead :

헤더는 링크를 보인다.

답변

2

아마도 Lastfm.de의 crossdomain.xml 파일입니까?

은 다음과 같은 도메인에서 플래시 액세스 할 수 있도록 설정됩니다

*.last.fm 
*.audioscrobbler.com 
87.117.229.54 

http://lastfm.de/crossdomain.xml

+0

어쩌면 모든 내용이 작동하고있을 수도 있습니다. 내가 그것을 시도한 이후로 오랜 시간이 걸렸다. 고마워요.하지만 그 일을 그만 두었습니다. – zzeroo

5

에 WEBrick 내가/O ... 이것은이 응답을 스트리밍 할 수하지 않는 의미 차단하고 있습니다. 예를 들어 YouTube 페이지를 방문하여 동영상을 볼 경우 프록시가 모든 동영상을 다운로드 할 때까지 브라우저에 스트림이 전달되지 않습니다. 다운로드하는 동안 브라우저에서 비디오를 재생하려면 EventMachine과 같은 I/O 솔루션이 아닌 블로킹을 찾아야합니다.