[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
Issue #12134 has been updated by Martin D端rst.
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74136] [Ruby trunk Feature#12062][Closed] supporting CIDR in ENV["no_proxy"]
From:
nobu@...
Date:
2016-03-04 10:57:00 UTC
List:
ruby-core #74136
Issue #12062 has been updated by Nobuyoshi Nakada.
Description updated
Status changed from Open to Closed
----------------------------------------
Feature #12062: supporting CIDR in ENV["no_proxy"]
https://bugs.ruby-lang.org/issues/12062#change-57281
* Author: 宏樹 熊崎
* Status: Closed
* Priority: Normal
* Assignee:
----------------------------------------
Ruby supports `ENV["no_proxy"]` in `lib/uri/generic.rb`
Current implementation expects comma separated hostname suffix and exact IP address.
It is similar to **`wget`** implementation.
(the difference is `wget` does suffix match only `no_proxy` hostname begins with period. But this difference is not so harmful.)
## Current Implementation
Ruby doesn't support CIDR style(ex. `192.168.2.0/24`) `no_proxy` instruction.
It is also mentioned too in this post.
http://unix.stackexchange.com/questions/23452/set-a-network-range-in-the-no-proxy-environment-variable
## Workaround
And mentioned workaround is below.
```sh
printf -v no_proxy '%s,' 10.1.{1..255}.{1..255};
export no_proxy="${no_proxy%,}";
```
I think it is ugly solution.
If one doesn't want to use proxy in private network(it is **very common** in company's network)
It may require configuration like
```sh
no_proxy=10.0.0.0,10.0.0.1,10.0.0.......10.255.255.255(about 219MB)
```
length of `ENV["no_proxy"]` will become about 219MB(!!)
It will take much more time in Ruby's URI implementation right now.
current `lib/uri/generic.rb` is below.
```ruby
no_proxy.scan(/([^:,]*)(?::(\d+))?/) {|host, port|
if /(\A|\.)#{Regexp.quote host}\z/i =~ self.host &&
(!port || self.port == port.to_i)
return nil
end
}
```
It requires regexp engine searching over 219MB string's data.
Long config file cause terrible performance suffer.
Linux standard might be `wget`, but **Python does not**.
Python implementation in a widely used library **requests** is [here](https://github.com/kennethreitz/requests/blob/master/requests/utils.py#L519-L542)
## Suggetsion
I think Python's solution is cool and fast and minimize surprising.
So I wish ruby to support CIDR style `no_proxy` instruction like Python.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>