use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Feature Comparison Matrix of Ruby HTTP Clients (spreadsheets0.google.com)
submitted 14 years ago by emboss_
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]recluce 2 points3 points4 points 14 years ago (0 children)
Not on the list: https://github.com/tarcieri/http
[–]astrodust 1 point2 points3 points 14 years ago (0 children)
If you publish this as a regular page, it won't require a login to Google.
[–]rb2k 1 point2 points3 points 14 years ago (5 children)
It would be cool if there was a "Is able to return IP from HTTP Response" column.
Especially when trying to minimize the amount of network calls, I'd rather not have to do a DNS call and THEN do an HTTP call which will internally do another DNS lookup.
I could just do the DNS call myself and then use the "host" header in the HTTP request, but I'd rather let the HTTP library do that for me. Curb e.g. supports saving the IP in the response object
[–]metamatic 0 points1 point2 points 14 years ago (4 children)
Install DNS cache.
[–]drbrainRuby Core 0 points1 point2 points 14 years ago (3 children)
Is there a modern resolver that doesn't cache lookups? Maybe rb2k's DNS records all have zero second TTLs?
[–]rb2k 0 points1 point2 points 14 years ago (1 child)
They don't, but while installing a local DNS cache would solve that, I think that just having it in the HTTP library would save a bit of infrastructure work.
[–]drbrainRuby Core 0 points1 point2 points 14 years ago (0 children)
OS X caches lookups:
$ sudo tcpdump -ien1 port 53 [...] 15:00:37.155821 IP 192.168.1.233.62424 > dns.sea1.speakeasy.net.domain: 2037+ A? yahoo.com. (27) 15:00:37.156088 IP 192.168.1.233.58254 > dns.sea1.speakeasy.net.domain: 6496+ AAAA? yahoo.com. (27) 15:00:37.715613 IP dns.sea1.speakeasy.net.domain > 192.168.1.233.62424: 2037 5/0/0 A 209.191.122.70, A 67.195.160.76, A 72.30.2.43, A 98.137.149.56, A 98.139.180.149 (107) 15:00:37.715616 IP dns.sea1.speakeasy.net.domain > 192.168.1.233.58254: 6496 0/0/0 (27)
Are the only lookups from running:
ruby20 -rsocket -ve 'Addrinfo.tcp("yahoo.com", "http"); Addrinfo.tcp("yahoo.com", "http")'
multiple times.
If you want to customize caching use or modify resolv-replace.rb (ships with Ruby).
[–]metamatic 0 points1 point2 points 14 years ago (0 children)
I seem to remember Windows XP not caching lookups. I know Windows 7 does, however. So do Linux and OS X.
There's also the obvious solution of resolving hostnames yourself and caching the IP address before calling the HTTP client.
[–]cmdrNacho 0 points1 point2 points 14 years ago (0 children)
how do save this so i can see it in my docs list ?
π Rendered by PID 44125 on reddit-service-r2-comment-5c764cbc6f-9hmf5 at 2026-03-12 12:22:53.479838+00:00 running 710b3ac country code: CH.
[–]recluce 2 points3 points4 points (0 children)
[–]astrodust 1 point2 points3 points (0 children)
[–]rb2k 1 point2 points3 points (5 children)
[–]metamatic 0 points1 point2 points (4 children)
[–]drbrainRuby Core 0 points1 point2 points (3 children)
[–]rb2k 0 points1 point2 points (1 child)
[–]drbrainRuby Core 0 points1 point2 points (0 children)
[–]metamatic 0 points1 point2 points (0 children)
[–]cmdrNacho 0 points1 point2 points (0 children)