Project

General

Profile

Actions

Feature #13719

open

[PATCH] net/http: allow existing socket arg for Net::HTTP.start

Added by normalperson (Eric Wong) over 4 years ago. Updated about 1 year ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:81920]

Description

This allows Net::HTTP users to use Unix domain sockets
or any other type of stream socket, including TCP.
Several HTTP servers (e.g. nginx and puma) support
listening on local Unix sockets instead of TCP.

* lib/net/http.rb (HTTP.start): handle :socket option
  (initialize): @live_socket defaults to nil
  (connect): only connect if @live_socket is missing
  (do_finish): remove reference to @live_socket
* test/net/http/test_http.rb (test_socket_arg_unix): new test

patch mirror:
https://80x24.org/spew/20170705112439.22359-1-e@80x24.org/raw


Files

Actions

Also available in: Atom PDF