net_http_unix 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/net_http_unix/version.rb +1 -1
- data/lib/net_x/http_unix.rb +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e49d1ff0a9774c1d709d8459d2c1810bd4eade0a
|
4
|
+
data.tar.gz: 708215709a1816da72543040c7837327223b7737
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 738aec71832876fb2d2cdbe90e7e657e5f5e04950032f673f5d4d395a85283ea48beefa5c49752a9363c89ba8ce3753abcfab6ed75d098b89ee594beb08a0f90
|
7
|
+
data.tar.gz: 242b27aea283444be01c250aca0c053ca2545e88b1a25d04410c9077d7bcb30dd915ede6cef6c3b904edd7b81b9a64e3fa5a0ec5c4a18c8505d2d6e8f884ca33
|
data/lib/net_x/http_unix.rb
CHANGED
@@ -9,8 +9,11 @@ class HTTPUnix < Net::HTTP
|
|
9
9
|
case address
|
10
10
|
when UNIX_REGEXP
|
11
11
|
@socket_type = 'unix'
|
12
|
-
@
|
13
|
-
|
12
|
+
@socket_path = address.sub(UNIX_REGEXP, '')
|
13
|
+
# Address and port are set to localhost so the HTTP client constructs
|
14
|
+
# a HOST request header nginx will accept.
|
15
|
+
@address = 'localhost'
|
16
|
+
@port = 80
|
14
17
|
else
|
15
18
|
@socket_type = 'inet'
|
16
19
|
end
|
@@ -28,8 +31,8 @@ class HTTPUnix < Net::HTTP
|
|
28
31
|
# connect_unix is an alternative implementation of Net::HTTP#connect specific
|
29
32
|
# to the use case of using a Unix Domain Socket.
|
30
33
|
def connect_unix
|
31
|
-
D "opening connection to #{
|
32
|
-
s = timeout(@open_timeout) { UNIXSocket.open(
|
34
|
+
D "opening connection to #{@socket_path}..."
|
35
|
+
s = timeout(@open_timeout) { UNIXSocket.open(@socket_path) }
|
33
36
|
D "opened"
|
34
37
|
@socket = BufferedIO.new(s)
|
35
38
|
@socket.read_timeout = @read_timeout
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net_http_unix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff McCune
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|