astro / astro/socksify-ruby

rfc3986_parser.rb:130:in `split': bad URI(is not URI?): "127.0.0.1:<my port>" (URI::InvalidURIError)

Open
#56 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
172
Forks
80
PR merge metrics
No merged PRs in 30d

Description

Just an FYI, I was getting errors long the lines of:

```ruby
bin/bundle exec ruby socks.rb
/home/erwin/.rbenv/versions/3.3.3/lib/ruby/3.3.0/uri/rfc3986_parser.rb:130:in `split': bad URI(is not URI?): "127.0.0.1:" (URI::InvalidURIError)
from /home/erwin/.rbenv/versions/3.3.3/lib/ruby/3.3.0/uri/rfc3986_parser.rb:135:in `parse'
from /home/erwin/.rbenv/versions/3.3.3/lib/ruby/3.3.0/uri/common.rb:185:in `parse'
from /home/erwin/.rbenv/versions/3.3.3/lib/ruby/3.3.0/uri/generic.rb:1563:in `find_proxy'
from /home/erwin/.rbenv/versions/3.3.3/lib/ruby/3.3.0/net/http.rb:1801:in `proxy_uri'
from /home/erwin/.rbenv/versions/3.3.3/lib/ruby/3.3.0/net/http.rb:1786:in `proxy?'
from /home/erwin/dev/awesome/localgems/ruby/3.3.0/bundler/gems/socksify-ruby-94cff4509997/lib/socksify/ruby3net_http_connectable.rb:13:in `connect' from /home/erwin/.rbenv/versions/3.3.3/lib/ruby/3.3.0/net/http.rb:1580:in `do_start'
from /home/erwin/.rbenv/versions/3.3.3/lib/ruby/3.3.0/net/http.rb:1569:in `start'
from /home/erwin/.rbenv/versions/3.3.3/lib/ruby/3.3.0/net/http.rb:1029:in `start'
from socks.rb:7:in `'
```

When I was running inside rails console I wasn't seeing the whole stack trace, so it took me an embarrassingly long time to get to the bottom of it...

But with the stacktrace in hand, you quickly figure out the issue is the in 'http.rb:1786' inside of 'def proxy?' where it's reading the values of `HTTP_PROXY` and `http_proxy` set in the environment.

Some tools can accept socks proxies for these, some can't... If you hit this error, you probably just need to `unset HTTP_PROXY` and `unset http_proxy`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.