jhass[m] changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.2, 3.0.4, 2.7.6: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
bbenno has quit [Ping timeout: 244 seconds]
libsys has quit [Ping timeout: 250 seconds]
libsys has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
ur5us has quit [Ping timeout: 255 seconds]
markong has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
Guest58 has joined #ruby
Guest58 has quit [Client Quit]
Sankalp has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
Sankalp has joined #ruby
Sankalp has quit [Client Quit]
Sankalp has joined #ruby
Sankalp has quit [Client Quit]
Sankalp has joined #ruby
Sankalp has quit [Client Quit]
Sankalp has joined #ruby
Sankalp has quit [Client Quit]
Sankalp has joined #ruby
Sankalp has quit [Client Quit]
Sankalp has joined #ruby
ur5us has quit [Ping timeout: 255 seconds]
John_Ivan has quit [Ping timeout: 240 seconds]
John_Ivan has joined #ruby
John_Ivan has quit [Ping timeout: 256 seconds]
John_Ivan has joined #ruby
TrufflePump has quit [Ping timeout: 240 seconds]
Ziyan has joined #ruby
favadi has joined #ruby
Rounin has quit [Ping timeout: 258 seconds]
TrufflePump has joined #ruby
Vonter has joined #ruby
TrufflePump has quit [Ping timeout: 246 seconds]
TrufflePump has joined #ruby
TrufflePump has quit [Ping timeout: 246 seconds]
totoro has joined #ruby
Guest14 has joined #ruby
TrufflePump has joined #ruby
TrufflePump has quit [Ping timeout: 244 seconds]
unixbsd has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.5]
TrufflePump has joined #ruby
John_Ivan has quit [Ping timeout: 255 seconds]
gr33n7007h has joined #ruby
TrufflePump has quit [Ping timeout: 255 seconds]
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kiki_lamb has joined #ruby
kiki_lamb has quit [Client Quit]
RickHull has quit [Ping timeout: 255 seconds]
TrufflePump has joined #ruby
TrufflePump has quit [Ping timeout: 272 seconds]
favadi has joined #ruby
mixfix41 has quit [Ping timeout: 255 seconds]
dionysus69 has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
Starfoxxes has quit [Ping timeout: 240 seconds]
acosta has quit [Quit: The Lounge - https://thelounge.chat]
acosta has joined #ruby
Starfoxxes has joined #ruby
Starfoxxes has quit [Ping timeout: 255 seconds]
jpn has joined #ruby
Starfoxxes has joined #ruby
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 246 seconds]
jpn has quit [Ping timeout: 258 seconds]
Ziyan_ has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
gproto23 has joined #ruby
Starfoxxes has quit [Ping timeout: 260 seconds]
fcser__ has quit [Ping timeout: 240 seconds]
Starfoxxes has joined #ruby
fcser has joined #ruby
Ziyan has joined #ruby
Starfoxxes has quit [Ping timeout: 258 seconds]
Starfoxxes has joined #ruby
Starfoxxes has quit [Ping timeout: 255 seconds]
jpn has joined #ruby
Starfoxxes has joined #ruby
jpn has quit [Ping timeout: 246 seconds]
jpn has joined #ruby
Starfoxxes has quit [Ping timeout: 244 seconds]
ur5us has joined #ruby
_ht has joined #ruby
Guest14 has quit [Ping timeout: 252 seconds]
Sankalp has quit [Ping timeout: 240 seconds]
sagax has quit [Read error: Connection reset by peer]
Sankalp has joined #ruby
jpn has quit [Ping timeout: 246 seconds]
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 255 seconds]
___nick___ has joined #ruby
arahael has quit [Ping timeout: 240 seconds]
jpn has joined #ruby
Ziyan_ has quit [Ping timeout: 255 seconds]
Ziyan has joined #ruby
TrufflePump has joined #ruby
arahael has joined #ruby
markong has joined #ruby
TrufflePump has quit [Ping timeout: 240 seconds]
a7tism has quit [Quit: Textual IRC Client: www.textualapp.com]
ur5us has quit [Ping timeout: 255 seconds]
Ziyan has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
szkl has joined #ruby
Ziyan has joined #ruby
weaksauc_ has joined #ruby
weaksauce has quit [Ping timeout: 240 seconds]
Rounin has joined #ruby
Ziyan has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
e2 has quit [Ping timeout: 256 seconds]
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sagax has joined #ruby
bbenno has joined #ruby
Ziyan has joined #ruby
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 240 seconds]
Ziyan has joined #ruby
Ziyan_ has quit [Ping timeout: 272 seconds]
favadi has joined #ruby
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Starfoxxes has joined #ruby
RickHull has joined #ruby
dionysus69 has quit [Ping timeout: 255 seconds]
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
szkl has quit [Quit: Connection closed for inactivity]
dionysus69 has joined #ruby
bbenno has quit [Ping timeout: 246 seconds]
atille_ has quit [Quit: bye]
atille has joined #ruby
John_Ivan has joined #ruby
TrufflePump has joined #ruby
e2 has joined #ruby
TrufflePump has quit [Ping timeout: 256 seconds]
gproto23 has quit [Ping timeout: 276 seconds]
work has joined #ruby
aeris has quit [Remote host closed the connection]
jpn has quit [Ping timeout: 276 seconds]
aeris has joined #ruby
voxxit has quit [Ping timeout: 255 seconds]
jpn has joined #ruby
dionysus69 has quit [Ping timeout: 250 seconds]
bbenno has joined #ruby
Common-Lisp has joined #ruby
bit4bit has joined #ruby
bit4bit has quit [Ping timeout: 260 seconds]
Ziyan has joined #ruby
favadi has joined #ruby
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
nmollerup has quit [Remote host closed the connection]
nmollerup has joined #ruby
gproto23 has joined #ruby
TrufflePump has joined #ruby
TrufflePump has quit [Ping timeout: 256 seconds]
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dangerousdave has joined #ruby
TrufflePump has joined #ruby
bbenno has quit [Ping timeout: 272 seconds]
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
Guest14 has joined #ruby
jpn has quit [Ping timeout: 246 seconds]
markong has quit [Ping timeout: 246 seconds]
TrufflePump has quit [Ping timeout: 246 seconds]
Guest14 has quit [Quit: Ping timeout (120 seconds)]
TrufflePump has joined #ruby
<Ziyan> I have a favour to ask. I am trying to convert a cURL request to use Net::HTTP. I am getting an error "EOFError: end of file reached". I have been looking at this for hours with no success. Looking at the documentation, I think I have done it right. I'd appreciate if one with experience working with Proxies with Net::HTTP/Faraday help me out. https://gist.github.com/ziyan-junaideen/4fe8e8937caada5d9e35a11884d7cb37
TrufflePump has quit [Ping timeout: 258 seconds]
<adam12> Ziyan: Run net_http_example.rb directly and get a better stacktrace. The line numbers dont' match in the one you provide.
<adam12> Ziyan: It could be a rack-mini_profiler issue too.
<adam12> Since I think it monkeypatches net/http
Guest14 has joined #ruby
<Ziyan> adam12 Thanks... an extension of last Friday's discussion...
<Ziyan> I updated the Gist with the Ruby file and the stack trace
<Ziyan> let me try run completely separately in a new gemset...
Guest14 has quit [Quit: Ping timeout (120 seconds)]
<adam12> Ziyan: could try running with rdbg and configure post mortem
<adam12> maybe you can go up stack and see if it indicates failure.
TrufflePump has joined #ruby
TrufflePump has quit [Ping timeout: 246 seconds]
bbenno has joined #ruby
work has quit [Quit: Connection closed for inactivity]
<havenwood> Ziyan: FWIW, no EOFError in this variant https://gist.github.com/havenwood/f909568b77c8b4a6e90e48433f82bcd8
<havenwood> Ziyan: Seems like `use_ssl` isn't working in yours? I dunno why on first glance, but couldn't reproduce redoing the request.
<havenwood> Net::HTTP is not my cup of tea.
<Ziyan> havenwood this issue happens the moment the proxy comes to the equation. Without the proxy stuff, it works fine.
<havenwood> Ziyan: Does that ^ gist work for you with the proxy?
<havenwood> Ziyan: Odd...
<Ziyan> havenwood there is no error when there is no proxy involved... your code should work, i tried some thing very similar.
<Ziyan> The issue happens when the proxy comes to picture
<Ziyan> I was using the ruby-debug-ide on VSCode.
<Ziyan> It turns out that the HTTP class connects to the proxy using TCP. Then it uses a BufferedIO instance to write some thing like "CONNECT eoftqqzi7ii7mmn.m.pipedream.net:443 HTTP/1.1\r\nHost: eoftqqzi7ii7mmn.m.pipedream.net:443\r\nProxy-Authorization: Basic VVN3OWhiUTFQUmh0NlF1M2FZR3pnZE5qOmYxZjRmY2RmLTFhN2ItNDdhZS1iMDU1LTNhOGRhNWYwNmQyMA==\r\n\r\n" to the socket.
<Ziyan> HTTPResponse.read_new(plain_sock).value is where it fails
<Ziyan> it is trying to read from the socket `sock.readline => end of file reached`
<Ziyan> I wonder if its the proxy. But then how did the cURL work. I think there are some VPNS that give SOCKS proxies. I think I will look for some SOCKS proxies I can get my hands on and see if I can get the code to work.
jpn has joined #ruby
<Ziyan> adam12 so I tried the debugger and walked the code. HTTP opens a socket and tries to write auth details to it and things like URI. The error happens because `sock.readline` is at end of file. I think I will try another SOCKS proxy to confirm its not this VGS proxy that is causing issue.
<adam12> Ziyan: So I was wrong. I thought SOCKS == HTTP but that's not correct.
<havenwood> Ziyan: I see what you're saying, gotcha. I was just looking at the cURL command only. >.>
<adam12> Ziyan: Using the proxy is definitely the issue, and it's expecting a HTTP proxy. I tried with a SOCKS proxy and it won't work.
<adam12> I can get it to work by installing a local copy of Squid
<adam12> Ziyan: Try enabling verbose mode and maybe see if that helps.
<adam12> http.set_debug_output $stderr
<adam12> (after setting ca_file is a good spot)
<Ziyan> adam12 I see. I am completely dumb about proxies. I slept through TCP lessons and lab work at uni. But I have worked with Squid. I wanted a name to try the code. But since you tried, I can leave it aside for now. Thanks.
<Ziyan> let me run with the verbose output
Neopolitan has quit [Quit: The Lounge - https://thelounge.chat]
Neopolitan has joined #ruby
<adam12> Ziyan: I used this squid image. docker run --name squid -d -p 3128:3128 datadog/squid
Neopolitan has quit [Client Quit]
Neopolitan has joined #ruby
<Ziyan> adam12 nice, thanks... I did it 11 years ago using make install on an OpenBSD server as an intern. I keep forgetting docker. Thanks agian!
<adam12> Ziyan: Can you compare output to curl -vvv?
<adam12> I'm curious about the Proxy-Authorization header.
<adam12> You don't set a Content-Type header but I'm not sure that matters yet, at you're not that far.
gproto23 has quit [Ping timeout: 258 seconds]
onyx has joined #ruby
<Ziyan> adam12 updated the gist again... i am going to update the Ruby file and see if he content type makes a difference
<adam12> Ziyan: It's definitely strange.
<adam12> My guess is it's on the proxies' end. Maybe it doesn't like your user agent or something.
<adam12> Actually that's not a good guess, because I don't think it sent that header yet.
<Ziyan> Content type header had no effect, as you said the failure happens before that as I see in the code.
<weaksauc_> hmm could the windows style linebreaks be causing an issue?
RedNifre has quit [Quit: changing power source]
<Ziyan> weaksauc_ suggest to replace the HTTP's \r\n with just \n ? Let me try 🤭
<Ziyan> nope, \r\n => \n didn't work out
___nick___ has quit [Ping timeout: 260 seconds]
<weaksauc_> worth a shot i guess
Neopolitan4 has joined #ruby
<Ziyan> weaksauc_ absolutely
Neopolitan has quit [Ping timeout: 258 seconds]
Neopolitan4 is now known as Neopolitan
_ht has quit [Remote host closed the connection]
jpn has quit [Ping timeout: 260 seconds]
gschanuel has joined #ruby
<Ziyan> adam12 weaksauc_ havenwood thanks for the help guys, its 2AM in Sri Lanka. I was updating the issue. I am going to check back tomorrow. Have a good day.
Common-Lisp has quit [Remote host closed the connection]
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
bbenno has quit [Quit: WeeChat 3.5]
dionysus69 has joined #ruby
dangerousdave has quit [Quit: Textual IRC Client: www.textualapp.com]
ur5us has joined #ruby
Guest14 has joined #ruby
markong has joined #ruby
TrufflePump has joined #ruby
TrufflePump has quit [Ping timeout: 256 seconds]
Guest14 has quit [Ping timeout: 252 seconds]
jpn has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
gr33n7007h has quit [Ping timeout: 246 seconds]
jpn has quit [Ping timeout: 255 seconds]
markong has quit [Ping timeout: 250 seconds]
Neopolitan has quit [Quit: The Lounge - https://thelounge.chat]
Neopolitan has joined #ruby
Neopolitan has quit [Client Quit]
Neopolitan has joined #ruby
tuxcrafter16 has joined #ruby
tuxcrafter has quit [Ping timeout: 252 seconds]
jpn has joined #ruby
onyx has quit [Quit: Leaving]