Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Proxyを経由する場合は?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
こあら  
View profile   Translate to Translated (View Original)
 More options Feb 12 2008, 7:05 am
From: "こあら" <SHUJI8...@gmail.com>
Date: Tue, 12 Feb 2008 04:05:22 -0800 (PST)
Local: Tues, Feb 12 2008 7:05 am
Subject: Proxyを経由する場合は?
社内などのProxyを経由する場合、どうすれば・・・・?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Makio Tsukamoto  
View profile   Translate to Translated (View Original)
 More options Feb 13 2008, 8:46 am
From: "Makio Tsukamoto" <tsukam...@gmail.com>
Date: Wed, 13 Feb 2008 22:46:16 +0900
Local: Wed, Feb 13 2008 8:46 am
Subject: Re: [fastladder-discuss-ja:11] Proxyを経由する場合は?

> 社内などのProxyを経由する場合、どうすれば・・・・?

Web画面側(フィードの追加周り)はうまくいって、以下にメモしてあります。

http://tsukamoto.tumblr.com/post/25954593

クローラ側は、lib/crawler.rbの103行目付近で同様にすればよいかと思ったのですが、URI::HTTP::find_proxyが呼び出せな かったようで、エラーを吐いてました。
誰か、解決法かヒントはありませんか?

----
塚本 牧生 <tsukam...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tagomoris  
View profile   Translate to Translated (View Original)
 More options Feb 14 2008, 11:10 pm
From: tagomoris <sigh1...@gmail.com>
Date: Thu, 14 Feb 2008 20:10:18 -0800 (PST)
Local: Thurs, Feb 14 2008 11:10 pm
Subject: Re: Proxyを経由する場合は?
クローラについて、設定を追加しそれを参照してProxyを経由するかどうか、という動作でパッチを書きました。
以下のURLに貼ってあります。
http://d.hatena.ne.jp/tagomoris/20080214/1202969056

環境変数を参照するのは避けたいしLANとWANでProxyを経由するかどうかを変えたいので
Rfeedfinderにもパッチを書いてます。


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tagomoris  
View profile   Translate to Translated (View Original)
 More options Feb 14 2008, 11:32 pm
From: tagomoris <sigh1...@gmail.com>
Date: Thu, 14 Feb 2008 20:32:54 -0800 (PST)
Local: Thurs, Feb 14 2008 11:32 pm
Subject: Re: Proxyを経由する場合は?
と思ったら app/controllers/subscribe_controller.rb の先頭で
Rfeedfinder.open_doc が
再定義されてますね。
これだとHTTPリクエストが全部 Crawler.fetch を通るはずなので大丈夫かな?

しかし Api::FeedController から Rfeedfinder が呼び出されたときの動作が
少し心配になります。
Rfeedfinder.open_docの再定義については別の場所で(Rails環境の初期化時にでも)行った
方が良さそうに思われますが、どうでしょう。


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Makio Tsukamoto  
View profile   Translate to Translated (View Original)
 More options Feb 15 2008, 1:53 am
From: "Makio Tsukamoto" <tsukam...@gmail.com>
Date: Fri, 15 Feb 2008 15:53:59 +0900
Local: Fri, Feb 15 2008 1:53 am
Subject: Re: [fastladder-discuss-ja:14] Re: Proxyを経由する場合は?

ああ、確かに。
Web画面からのフィード追加は、クローラ修正でうまくいってそうに見えます。

環境変数でのPROXY指定版を書いてみました。
前回やっていたrfeedfinder.rb、openuri.rbへの修正は不要で、crawler.rbへの適用だけで良さそうです。

> LANとWANでProxyを経由するかどうかを変えたいので

今回はURIオブジェクトからfind_proxyを呼んでプロキシを決定するようにしました。この形だとNO_PROXY(プロキシを使用しないも考慮されて いるのではないかと思います。

----
塚本 牧生 <tsukam...@gmail.com>

  lib_crawler_rb.patch.txt
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Makio Tsukamoto  
View profile   Translate to Translated (View Original)
 More options Feb 15 2008, 5:20 am
From: "Makio Tsukamoto" <tsukam...@gmail.com>
Date: Fri, 15 Feb 2008 19:20:48 +0900
Local: Fri, Feb 15 2008 5:20 am
Subject: Re: [fastladder-discuss-ja:14] Re: Proxyを経由する場合は?

> 環境変数でのPROXY指定版を書いてみました。
> 前回やっていたrfeedfinder.rb、openuri.rbへの修正は不要で、crawler.rbへの
> 適用だけで良さそうです。

パッチ、再送します。
svn coした現在のtrunk(rev.21)に対するパッチになっています。

----
塚本 牧生 <tsukam...@gmail.com>

  fastladder_proxy.patch.txt
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
faultier  
View profile   Translate to Translated (View Original)
 More options Feb 15 2008, 5:45 am
From: faultier <rotesh...@gmail.com>
Date: Fri, 15 Feb 2008 02:45:40 -0800 (PST)
Local: Fri, Feb 15 2008 5:45 am
Subject: Re: Proxyを経由する場合は?
Rfeedfinder.open_docの再定義は確かにsubscribe_controller.rbとは別な箇所でやるべきですね。
これは外に出しておきます。
また、Rfeedfinderは別な不具合の原因になっているようなので今後置き替えるつもりではあります。

On 2月15日, 午後1:32, tagomoris <sigh1...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
sigh1...@gmail.com  
View profile   Translate to Translated (View Original)
 More options Feb 14 2008, 12:44 am
From: sigh1...@gmail.com
Date: Wed, 13 Feb 2008 21:44:20 -0800 (PST)
Local: Thurs, Feb 14 2008 12:44 am
Subject: Re: Proxyを経由する場合は?
以下のようなパッチを書いてみました。
認証つきProxyが近傍に無いので、そこの動作は未確認ですが……。

config/initializers/constants.rb に以下のような設定を記述して使用することを想定しています。
CRAWL_HTTP_WITH_PROXY = true
CRAWL_HTTP_PROXY_SERVER = 'proxy.intellilink.co.jp'
CRAWL_HTTP_PROXY_PORT = 8080
CRAWL_HTTP_PROXY_USER = nil
CRAWL_HTTP_PROXY_PASS = nil
CRAWL_PROXY_EXCEPTIONS_HOSTS =
  [
   /.*\.mylocaldomain/,
   /192\.168\..*/
  ]

$ diff -u ../fastladder/lib/crawler.rb lib/crawler.rb
--- ../fastladder/lib/crawler.rb        2008-02-08 20:22:10.000000000
+0900
+++ lib/crawler.rb      2008-02-14 14:24:31.773592550 +0900
@@ -100,7 +100,17 @@

   def fetch(link, options = {})
     uri = link.is_a?(URI) ? link : URI(link)
-    http = Net::HTTP.new(uri.host, uri.port)
+    proxy = if defined? CRAWL_HTTP_WITH_PROXY and
CRAWL_HTTP_WITH_PROXY
+              raise "ProxyServer or ProxyPort missing" unless
defined? CRAWL_HTTP_PROXY_SERVER and defined? CRAWL_HTTP_PROXY_PORT
+              if defined? CRAWL_PROXY_EXCEPTIONS_HOSTS and
CRAWL_PROXY_EXCEPTIONS_HOSTS.inject(false){|b,r| b or uri.host =~ r}
+                [nil,nil,nil,nil]
+              else
+                [CRAWL_HTTP_PROXY_SERVER, CRAWL_HTTP_PROXY_PORT,
(defined? CRAWL_HTTP_PROXY_USER ? CRAWL_HTTP_PROXY_USER : nil),
(defined? CRAWL_HTTP_PROXY_PASS ? CRAWL_HTTP_PROXY_PASS : nil)]
+              end
+            else
+              [nil,nil,nil,nil]
+            end
+    http = Net::HTTP.Proxy(*proxy).new(uri.host, uri.port)
     case uri.scheme
     when "http"
     when "https"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
faultier  
View profile   Translate to Translated (View Original)
 More options Feb 19 2008, 6:45 am
From: faultier <rotesh...@gmail.com>
Date: Tue, 19 Feb 2008 03:45:43 -0800 (PST)
Local: Tues, Feb 19 2008 6:45 am
Subject: Re: Proxyを経由する場合は?
Proxyに関してですが、trunkの方で対応しました。

enviroments.rbの中で以下の部分を変更すると、
fetch時にProxy経由で取得するようになります。

Fastladder::Initializer::run do |config|
  # URI::HTTP.buildの引数になる項目をハッシュで
  # URIオブジェクトでも可
  config.proxy = {
    :scheme => 'http', # Default: http
    :port => 8080, # Default: 80
    :host => 'proxy.example.com',
    :user => 'user',
    :password => 'password'
  }
  # 除外するホストのリストを正規表現で
  config.proxy_except_hosts = [
    /localhost/
  ]
end

これでFastladder::HTTP_PROXYとFastladder::HTTP_PROXY_EXCEPT_HOSTSが定義され、
crawlerおよびapp本体からfetchを行なうときはこれを経由するようになってます。


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ann Rice  
View profile   Translate to Translated (View Original)
 More options Mar 28 2008, 8:17 am
From: Ann Rice <aunivDRV...@gmail.com>
Date: Fri, 28 Mar 2008 05:17:50 -0700 (PDT)
Local: Fri, Mar 28 2008 8:17 am
Subject: Re: Proxyを経由する場合は?
http://wikipedlla.com/proxy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »