browsermob-proxy 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/browsermob/proxy/client.rb +5 -2
- data/lib/browsermob/proxy/server.rb +3 -3
- data/lib/browsermob/proxy/version.rb +1 -1
- 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: e8a8e4e9be3341956bda02727640a15ed856e6e2
|
4
|
+
data.tar.gz: 4fb4be71eb9e5e549593e4f7ad647093c5847128
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1e58e4cc70d04b3b29ea9f468698be7ba6b7420ec17fb4567a02746d1fc904a6ff1a44f10521e0742f25b62fe2e80eaf9f3ec06e19d57c3563decc300792cfc
|
7
|
+
data.tar.gz: 9a220eac9753cd7d3fd20815b7d7abd304bea9294213103a37fa8de63407e2abaccabe08940aca44672386d2dad521f9093e96941e44123a125bc99f47e4cb07
|
@@ -4,13 +4,16 @@ module BrowserMob
|
|
4
4
|
class Client
|
5
5
|
attr_reader :host, :port
|
6
6
|
|
7
|
-
def self.from(server_url)
|
7
|
+
def self.from(server_url, port = nil)
|
8
8
|
# ActiveSupport may define Object#load, so we can't use MultiJson.respond_to? here.
|
9
9
|
sm = MultiJson.singleton_methods.map { |e| e.to_sym }
|
10
10
|
decode_method = sm.include?(:load) ? :load : :decode
|
11
11
|
|
12
|
+
new_proxy_url = URI.join(server_url, "proxy")
|
13
|
+
new_proxy_url.query = "port=#{port}" if port
|
14
|
+
|
12
15
|
port = MultiJson.send(decode_method,
|
13
|
-
RestClient.post(
|
16
|
+
RestClient.post(new_proxy_url.to_s, '')
|
14
17
|
).fetch('port')
|
15
18
|
|
16
19
|
uri = URI.parse(File.join(server_url, "proxy", port.to_s))
|
@@ -43,8 +43,8 @@ module BrowserMob
|
|
43
43
|
"http://localhost:#{port}"
|
44
44
|
end
|
45
45
|
|
46
|
-
def create_proxy
|
47
|
-
Client.from url
|
46
|
+
def create_proxy(port = nil)
|
47
|
+
Client.from url, port
|
48
48
|
end
|
49
49
|
|
50
50
|
def stop
|
@@ -108,4 +108,4 @@ module BrowserMob
|
|
108
108
|
|
109
109
|
end # Server
|
110
110
|
end # Proxy
|
111
|
-
end # BrowserMob
|
111
|
+
end # BrowserMob
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browsermob-proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jari.bakken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|