browsed 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/Gemfile.lock +2 -2
  4. data/README.md +12 -17
  5. data/bin/browse +13 -10
  6. data/lib/browsed.rb +9 -2
  7. data/lib/browsed/browser.rb +82 -0
  8. data/lib/browsed/chrome.rb +21 -12
  9. data/lib/browsed/client.rb +48 -130
  10. data/lib/browsed/constants.rb +7 -1
  11. data/lib/browsed/errors.rb +1 -0
  12. data/lib/browsed/extensions/hash.rb +27 -0
  13. data/lib/browsed/firefox.rb +18 -17
  14. data/lib/browsed/manager.rb +5 -5
  15. data/lib/browsed/{poltergeist.rb → phantomjs.rb} +2 -2
  16. data/lib/browsed/proxies.rb +26 -0
  17. data/lib/browsed/{extensions → proxies}/chrome/proxy_authentication.rb +3 -3
  18. data/lib/browsed/proxies/proxy-chain-server/node_modules/.bin/portastic +1 -0
  19. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/LICENSE +21 -0
  20. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/README.md +57 -0
  21. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/changelog.md +1 -0
  22. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.core.js +3824 -0
  23. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.core.min.js +31 -0
  24. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.js +5666 -0
  25. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.min.js +31 -0
  26. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/any.js +21 -0
  27. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/assert.js +55 -0
  28. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/async.js +165 -0
  29. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/bind.js +67 -0
  30. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/bluebird.js +11 -0
  31. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/call_get.js +123 -0
  32. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/cancel.js +129 -0
  33. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/catch_filter.js +42 -0
  34. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/context.js +69 -0
  35. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/debuggability.js +934 -0
  36. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/direct_resolve.js +46 -0
  37. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/each.js +30 -0
  38. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/errors.js +116 -0
  39. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/es5.js +80 -0
  40. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/filter.js +12 -0
  41. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/finally.js +146 -0
  42. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/generators.js +223 -0
  43. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/join.js +168 -0
  44. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/map.js +168 -0
  45. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/method.js +55 -0
  46. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/nodeback.js +51 -0
  47. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/nodeify.js +58 -0
  48. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/promise.js +789 -0
  49. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/promise_array.js +185 -0
  50. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/promisify.js +314 -0
  51. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/props.js +118 -0
  52. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/queue.js +73 -0
  53. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/race.js +49 -0
  54. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/reduce.js +172 -0
  55. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/schedule.js +62 -0
  56. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/settle.js +43 -0
  57. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/some.js +148 -0
  58. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/synchronous_inspection.js +103 -0
  59. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/thenables.js +86 -0
  60. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/timers.js +93 -0
  61. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/using.js +226 -0
  62. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/util.js +389 -0
  63. data/lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/package.json +102 -0
  64. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/CHANGELOG.md +408 -0
  65. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/LICENSE +22 -0
  66. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/Readme.md +428 -0
  67. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/index.js +1224 -0
  68. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/package.json +70 -0
  69. data/lib/browsed/proxies/proxy-chain-server/node_modules/commander/typings/index.d.ts +310 -0
  70. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/.coveralls.yml +1 -0
  71. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/.eslintrc +11 -0
  72. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/.npmignore +9 -0
  73. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/.travis.yml +14 -0
  74. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/CHANGELOG.md +362 -0
  75. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/LICENSE +19 -0
  76. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/Makefile +50 -0
  77. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/README.md +312 -0
  78. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/component.json +19 -0
  79. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/karma.conf.js +70 -0
  80. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/node.js +1 -0
  81. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/package.json +88 -0
  82. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/browser.js +185 -0
  83. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/debug.js +202 -0
  84. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/index.js +10 -0
  85. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/inspector-log.js +15 -0
  86. data/lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/node.js +248 -0
  87. data/lib/browsed/proxies/proxy-chain-server/node_modules/ms/index.js +152 -0
  88. data/lib/browsed/proxies/proxy-chain-server/node_modules/ms/license.md +21 -0
  89. data/lib/browsed/proxies/proxy-chain-server/node_modules/ms/package.json +69 -0
  90. data/lib/browsed/proxies/proxy-chain-server/node_modules/ms/readme.md +51 -0
  91. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/LICENSE +13 -0
  92. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/README.md +148 -0
  93. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/bin/portastic +65 -0
  94. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/history.md +7 -0
  95. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/index.js +4 -0
  96. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/lib/monitor.js +59 -0
  97. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/lib/portastic.js +167 -0
  98. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/LICENSE +21 -0
  99. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/README.md +677 -0
  100. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/changelog.md +1730 -0
  101. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/browser/bluebird.js +4892 -0
  102. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/browser/bluebird.min.js +31 -0
  103. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/any.js +21 -0
  104. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/assert.js +55 -0
  105. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/async.js +150 -0
  106. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/bind.js +72 -0
  107. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/bluebird.js +11 -0
  108. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/call_get.js +123 -0
  109. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/cancel.js +48 -0
  110. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/captured_trace.js +493 -0
  111. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/catch_filter.js +66 -0
  112. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/context.js +38 -0
  113. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/debuggability.js +162 -0
  114. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/direct_resolve.js +63 -0
  115. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/each.js +12 -0
  116. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/errors.js +111 -0
  117. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/es5.js +80 -0
  118. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/filter.js +12 -0
  119. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/finally.js +98 -0
  120. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/generators.js +136 -0
  121. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/join.js +107 -0
  122. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/map.js +133 -0
  123. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/method.js +44 -0
  124. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/nodeify.js +59 -0
  125. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/progress.js +76 -0
  126. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promise.js +759 -0
  127. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promise_array.js +142 -0
  128. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promise_resolver.js +123 -0
  129. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promisify.js +307 -0
  130. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/props.js +79 -0
  131. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/queue.js +90 -0
  132. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/race.js +47 -0
  133. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/reduce.js +148 -0
  134. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/schedule.js +35 -0
  135. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/settle.js +40 -0
  136. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/some.js +125 -0
  137. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/synchronous_inspection.js +94 -0
  138. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/thenables.js +84 -0
  139. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/timers.js +64 -0
  140. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/using.js +213 -0
  141. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/util.js +321 -0
  142. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/package.json +103 -0
  143. data/lib/browsed/proxies/proxy-chain-server/node_modules/portastic/package.json +69 -0
  144. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/CHANGELOG.md +109 -0
  145. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/LICENSE +201 -0
  146. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/README.md +278 -0
  147. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/anonymize_proxy.js +100 -0
  148. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_base.js +319 -0
  149. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_custom_response.js +96 -0
  150. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_forward.js +173 -0
  151. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_tunnel_chain.js +132 -0
  152. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_tunnel_direct.js +89 -0
  153. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_tunnel_tcp_chain.js +271 -0
  154. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/index.js +26 -0
  155. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/run_locally.js +66 -0
  156. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/server.js +595 -0
  157. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/tcp_tunnel.js +138 -0
  158. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/testing_tcp_service.js +37 -0
  159. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/tools.js +220 -0
  160. data/lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/package.json +104 -0
  161. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/LICENSE +23 -0
  162. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/README.md +28 -0
  163. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/package.json +81 -0
  164. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/underscore-min.js +5 -0
  165. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/underscore-min.js.map +1 -0
  166. data/lib/browsed/proxies/proxy-chain-server/node_modules/underscore/underscore.js +1692 -0
  167. data/lib/browsed/proxies/proxy-chain-server/package-lock.json +63 -0
  168. data/lib/browsed/proxies/proxy-chain-server/package.json +15 -0
  169. data/lib/browsed/proxies/proxy-chain-server/server.js +25 -0
  170. data/lib/browsed/proxies/proxy_chain.rb +36 -0
  171. data/lib/browsed/version.rb +1 -1
  172. metadata +160 -4
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "proxy-chain-server",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 1,
5
+ "requires": true,
6
+ "dependencies": {
7
+ "bluebird": {
8
+ "version": "3.5.5",
9
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz",
10
+ "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w=="
11
+ },
12
+ "commander": {
13
+ "version": "2.20.0",
14
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz",
15
+ "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ=="
16
+ },
17
+ "debug": {
18
+ "version": "2.6.9",
19
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
20
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
21
+ "requires": {
22
+ "ms": "2.0.0"
23
+ }
24
+ },
25
+ "ms": {
26
+ "version": "2.0.0",
27
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
28
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
29
+ },
30
+ "portastic": {
31
+ "version": "1.0.1",
32
+ "resolved": "https://registry.npmjs.org/portastic/-/portastic-1.0.1.tgz",
33
+ "integrity": "sha1-HJgF1D+uj2pAzw28d5QJGi6dDSo=",
34
+ "requires": {
35
+ "bluebird": "^2.9.34",
36
+ "commander": "^2.8.1",
37
+ "debug": "^2.2.0"
38
+ },
39
+ "dependencies": {
40
+ "bluebird": {
41
+ "version": "2.11.0",
42
+ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz",
43
+ "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE="
44
+ }
45
+ }
46
+ },
47
+ "proxy-chain": {
48
+ "version": "0.2.7",
49
+ "resolved": "https://registry.npmjs.org/proxy-chain/-/proxy-chain-0.2.7.tgz",
50
+ "integrity": "sha512-e0s94WDfooeC3zQkvIJ/Eudiy/AywTQK4K6PMYbZdBE2m/eug54ThgCPdBE4txHvzi0A0gAVbX04Kt4RygTlRQ==",
51
+ "requires": {
52
+ "bluebird": "^3.5.1",
53
+ "portastic": "^1.0.1",
54
+ "underscore": "^1.9.1"
55
+ }
56
+ },
57
+ "underscore": {
58
+ "version": "1.9.1",
59
+ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz",
60
+ "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg=="
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "proxy-chain-server",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "server.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "proxy-chain": "^0.2.7"
14
+ }
15
+ }
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict'
4
+
5
+ if (process.argv.length != 4) {
6
+ console.log("usage: node server.js proxy_url instance_id")
7
+ process.exit(0)
8
+ }
9
+
10
+ const proxyUrl = process.argv[2].trim();
11
+ const instanceId = process.argv[3].trim();
12
+
13
+ const proxyChain = require('proxy-chain');
14
+ let anonymizedProxyUrl = null;
15
+
16
+ (async() => {
17
+ anonymizedProxyUrl = await proxyChain.anonymizeProxy(proxyUrl);
18
+ console.log(anonymizedProxyUrl);
19
+ })();
20
+
21
+ process.on('SIGINT', function() {
22
+ proxyChain.closeAnonymizedProxy(anonymizedProxyUrl, true, () => {
23
+ console.log(`Closed proxy ${anonymizedProxyUrl}`);
24
+ });
25
+ });
@@ -0,0 +1,36 @@
1
+ module Browsed
2
+ module Proxies
3
+ class ProxyChain
4
+ attr_accessor :script_path, :instance_id, :command, :pid, :generated_proxy_url
5
+
6
+ def initialize(instance_id = nil)
7
+ self.script_path = File.expand_path("../proxy-chain-server/server.js", __FILE__)
8
+ self.instance_id = instance_id.to_s.empty? ? SecureRandom.hex : instance_id
9
+ self.command = "ps aux | awk '/proxy-chain-instance-id-#{instance_id}/'"
10
+ self.generated_proxy_url = nil
11
+ end
12
+
13
+ def start_server(proxy_url)
14
+ IO.popen("((node #{self.script_path} \"#{proxy_url}\" proxy-chain-instance-id-#{instance_id} &)&)") do |io|
15
+ self.generated_proxy_url = io.gets&.strip
16
+ end
17
+
18
+ identify_pid
19
+
20
+ self.generated_proxy_url
21
+ end
22
+
23
+ def identify_pid
24
+ process = `#{self.command}`.split("\n")&.select { |p| p =~ /proxy-chain-instance-id-#{self.instance_id}$/i }&.first
25
+ parts = process.split(' ')
26
+ pid = parts && parts.any? ? parts[1] : nil
27
+ self.pid = !pid.to_s.empty? ? pid.to_i : nil
28
+ end
29
+
30
+ def stop_server
31
+ Process.kill("INT", self.pid) unless self.pid.to_s.empty?
32
+ end
33
+
34
+ end
35
+ end
36
+ end
@@ -1,3 +1,3 @@
1
1
  module Browsed
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browsed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-02 00:00:00.000000000 Z
11
+ date: 2019-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -163,15 +163,171 @@ files:
163
163
  - bin/setup
164
164
  - browsed.gemspec
165
165
  - lib/browsed.rb
166
+ - lib/browsed/browser.rb
166
167
  - lib/browsed/chrome.rb
167
168
  - lib/browsed/client.rb
168
169
  - lib/browsed/configuration.rb
169
170
  - lib/browsed/constants.rb
170
171
  - lib/browsed/errors.rb
171
- - lib/browsed/extensions/chrome/proxy_authentication.rb
172
+ - lib/browsed/extensions/hash.rb
172
173
  - lib/browsed/firefox.rb
173
174
  - lib/browsed/manager.rb
174
- - lib/browsed/poltergeist.rb
175
+ - lib/browsed/phantomjs.rb
176
+ - lib/browsed/proxies.rb
177
+ - lib/browsed/proxies/chrome/proxy_authentication.rb
178
+ - lib/browsed/proxies/proxy-chain-server/node_modules/.bin/portastic
179
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/LICENSE
180
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/README.md
181
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/changelog.md
182
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.core.js
183
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.core.min.js
184
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.js
185
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/browser/bluebird.min.js
186
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/any.js
187
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/assert.js
188
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/async.js
189
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/bind.js
190
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/bluebird.js
191
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/call_get.js
192
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/cancel.js
193
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/catch_filter.js
194
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/context.js
195
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/debuggability.js
196
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/direct_resolve.js
197
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/each.js
198
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/errors.js
199
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/es5.js
200
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/filter.js
201
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/finally.js
202
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/generators.js
203
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/join.js
204
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/map.js
205
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/method.js
206
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/nodeback.js
207
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/nodeify.js
208
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/promise.js
209
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/promise_array.js
210
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/promisify.js
211
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/props.js
212
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/queue.js
213
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/race.js
214
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/reduce.js
215
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/schedule.js
216
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/settle.js
217
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/some.js
218
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/synchronous_inspection.js
219
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/thenables.js
220
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/timers.js
221
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/using.js
222
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/js/release/util.js
223
+ - lib/browsed/proxies/proxy-chain-server/node_modules/bluebird/package.json
224
+ - lib/browsed/proxies/proxy-chain-server/node_modules/commander/CHANGELOG.md
225
+ - lib/browsed/proxies/proxy-chain-server/node_modules/commander/LICENSE
226
+ - lib/browsed/proxies/proxy-chain-server/node_modules/commander/Readme.md
227
+ - lib/browsed/proxies/proxy-chain-server/node_modules/commander/index.js
228
+ - lib/browsed/proxies/proxy-chain-server/node_modules/commander/package.json
229
+ - lib/browsed/proxies/proxy-chain-server/node_modules/commander/typings/index.d.ts
230
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/.coveralls.yml
231
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/.eslintrc
232
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/.npmignore
233
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/.travis.yml
234
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/CHANGELOG.md
235
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/LICENSE
236
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/Makefile
237
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/README.md
238
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/component.json
239
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/karma.conf.js
240
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/node.js
241
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/package.json
242
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/browser.js
243
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/debug.js
244
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/index.js
245
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/inspector-log.js
246
+ - lib/browsed/proxies/proxy-chain-server/node_modules/debug/src/node.js
247
+ - lib/browsed/proxies/proxy-chain-server/node_modules/ms/index.js
248
+ - lib/browsed/proxies/proxy-chain-server/node_modules/ms/license.md
249
+ - lib/browsed/proxies/proxy-chain-server/node_modules/ms/package.json
250
+ - lib/browsed/proxies/proxy-chain-server/node_modules/ms/readme.md
251
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/LICENSE
252
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/README.md
253
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/bin/portastic
254
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/history.md
255
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/index.js
256
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/lib/monitor.js
257
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/lib/portastic.js
258
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/LICENSE
259
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/README.md
260
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/changelog.md
261
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/browser/bluebird.js
262
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/browser/bluebird.min.js
263
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/any.js
264
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/assert.js
265
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/async.js
266
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/bind.js
267
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/bluebird.js
268
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/call_get.js
269
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/cancel.js
270
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/captured_trace.js
271
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/catch_filter.js
272
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/context.js
273
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/debuggability.js
274
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/direct_resolve.js
275
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/each.js
276
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/errors.js
277
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/es5.js
278
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/filter.js
279
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/finally.js
280
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/generators.js
281
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/join.js
282
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/map.js
283
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/method.js
284
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/nodeify.js
285
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/progress.js
286
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promise.js
287
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promise_array.js
288
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promise_resolver.js
289
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/promisify.js
290
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/props.js
291
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/queue.js
292
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/race.js
293
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/reduce.js
294
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/schedule.js
295
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/settle.js
296
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/some.js
297
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/synchronous_inspection.js
298
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/thenables.js
299
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/timers.js
300
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/using.js
301
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/js/main/util.js
302
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/node_modules/bluebird/package.json
303
+ - lib/browsed/proxies/proxy-chain-server/node_modules/portastic/package.json
304
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/CHANGELOG.md
305
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/LICENSE
306
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/README.md
307
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/anonymize_proxy.js
308
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_base.js
309
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_custom_response.js
310
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_forward.js
311
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_tunnel_chain.js
312
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_tunnel_direct.js
313
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/handler_tunnel_tcp_chain.js
314
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/index.js
315
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/run_locally.js
316
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/server.js
317
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/tcp_tunnel.js
318
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/testing_tcp_service.js
319
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/build/tools.js
320
+ - lib/browsed/proxies/proxy-chain-server/node_modules/proxy-chain/package.json
321
+ - lib/browsed/proxies/proxy-chain-server/node_modules/underscore/LICENSE
322
+ - lib/browsed/proxies/proxy-chain-server/node_modules/underscore/README.md
323
+ - lib/browsed/proxies/proxy-chain-server/node_modules/underscore/package.json
324
+ - lib/browsed/proxies/proxy-chain-server/node_modules/underscore/underscore-min.js
325
+ - lib/browsed/proxies/proxy-chain-server/node_modules/underscore/underscore-min.js.map
326
+ - lib/browsed/proxies/proxy-chain-server/node_modules/underscore/underscore.js
327
+ - lib/browsed/proxies/proxy-chain-server/package-lock.json
328
+ - lib/browsed/proxies/proxy-chain-server/package.json
329
+ - lib/browsed/proxies/proxy-chain-server/server.js
330
+ - lib/browsed/proxies/proxy_chain.rb
175
331
  - lib/browsed/version.rb
176
332
  homepage: https://github.com/SebastianJ
177
333
  licenses: