【问题标题】:Webrick transparent proxyWebrick 透明代理
【发布时间】:2011-02-01 12:06:27
【问题描述】:

我正在运行一个绝对简单的代理。

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 的嵌入式 Flash 播放器不起作用。

标题看起来链接:

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

我需要一些提示,为什么或什么通信干扰。

【问题讨论】:

    标签: ruby http proxy webrick


    【解决方案1】:

    WEBrick 正在阻塞 I/O ... 这意味着它无法流式传输响应。例如,如果您在 youtube 页面上观看视频,则在代理下载所有视频内容之前,不会将流转发到您的浏览器。 如果您希望视频在下载过程中在浏览器中播放,则必须寻找像 EventMachine 这样的非阻塞 I/O 解决方案。

    【讨论】:

      【解决方案2】:

      也许是 Lastfm.de 上的 crossdomain.xml 文件?

      设置为只允许以下域的flash访问:

      *.last.fm
      *.audioscrobbler.com
      87.117.229.54
      

      http://lastfm.de/crossdomain.xml

      【讨论】:

      • 也许,甚至也许整个东西现在都在工作。我已经很久没有尝试过了。谢谢,但我已经停止工作了。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-25
      • 2010-10-15
      • 1970-01-01
      • 1970-01-01
      • 2012-05-22
      相关资源
      最近更新 更多