Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket was remotely closed (SocketError) #49

Open
jan opened this issue Oct 7, 2022 · 1 comment
Open

Socket was remotely closed (SocketError) #49

jan opened this issue Oct 7, 2022 · 1 comment

Comments

@jan
Copy link

jan commented Oct 7, 2022

The basic synchronous call from the README works, but it breaks when I change the host from nghttp2.org to the one that i actually want to request from:

# create a client
# client = NetHttp2::Client.new("http://nghttp2.org") # <- works
client = NetHttp2::Client.new("http://httpbin.org") # <- does not work; same with other hosts

# send request
response = client.call(:get, '/')

# ...
#<Thread:0x00007f95a592c4e8@/Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:112 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
	5: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:114:in `block (2 levels) in ensure_open'
	4: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:142:in `socket_loop'
	3: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:142:in `loop'
	2: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:145:in `block in socket_loop'
	1: from <internal:prelude>:73:in `read_nonblock'
<internal:prelude>:73:in `__read_nonblock': end of file reached (EOFError)
	2: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:113:in `block (2 levels) in ensure_open'
	1: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:119:in `rescue in block (2 levels) in ensure_open'
/Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:134:in `callback_or_raise': Socket was remotely closed (SocketError)
Traceback (most recent call last):
	5: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:114:in `block (2 levels) in ensure_open'
	4: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:142:in `socket_loop'
	3: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:142:in `loop'
	2: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:145:in `block in socket_loop'
	1: from <internal:prelude>:73:in `read_nonblock'
<internal:prelude>:73:in `__read_nonblock': end of file reached (EOFError)
	2: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:113:in `block (2 levels) in ensure_open'
	1: from /Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:119:in `rescue in block (2 levels) in ensure_open'
/Library/Ruby/Gems/2.6.0/gems/net-http2-0.18.4/lib/net-http2/client.rb:134:in `callback_or_raise': Socket was remotely closed (SocketError)

MacOS 10.15.7
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

@akostadinov
Copy link

Are you sure you don't have network problems or your ip is blacklisted or something? Works for me and probably for many other people with random HTTP2 enabled web servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants