Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. [![dependencies Status](https://david-dm.org/np-maintain/global-tunnel/status.svg)](https://david-dm.org/np-maintain/global-tunnel)
  2. [![devDependencies Status](https://david-dm.org/np-maintain/global-tunnel/dev-status.svg)](https://david-dm.org/np-maintain/global-tunnel?type=dev)
  3. [![Build Status](https://travis-ci.org/np-maintain/global-tunnel.png)](https://travis-ci.org/np-maintain/global-tunnel) [![Greenkeeper badge](https://badges.greenkeeper.io/np-maintain/global-tunnel.svg)](https://greenkeeper.io/)
  4. # global-tunnel
  5. Configures the [global
  6. `http`](http://nodejs.org/docs/v0.10.24/api/all.html#all_http_globalagent) and
  7. [`https`](http://nodejs.org/docs/v0.10.24/api/all.html#all_https_globalagent)
  8. agents to use an upstream HTTP proxy.
  9. Works transparently to tunnel modules that use node's default [`http.request()`
  10. method](http://nodejs.org/docs/v0.10.24/api/all.html#all_http_request_options_callback)
  11. as well as the popular [`request` module](https://npmjs.org/package/request).
  12. # Installation
  13. You can install this package by just executing the following:
  14. npm install global-tunnel-ng
  15. # Usage
  16. To make all HTTP and HTTPS connections go through an outbound HTTP proxy:
  17. ```js
  18. var globalTunnel = require('global-tunnel-ng');
  19. globalTunnel.initialize({
  20. host: '10.0.0.10',
  21. port: 8080,
  22. proxyAuth: 'userId:password', // optional authentication
  23. sockets: 50 // optional pool size for each http and https
  24. });
  25. ```
  26. This will use the `CONNECT` method for HTTPS requests and absolute-URIs for
  27. HTTP requests, which is how many network proxies are configured.
  28. Optionally, to tear-down the global agent and restore node's default global
  29. agents:
  30. ```js
  31. globalTunnel.end();
  32. ```
  33. Any active connections will be allowed to run to completion, but new
  34. connections will use the default global agents.
  35. # Advanced Usage
  36. ## Options
  37. The complete list of options to `globalTunnel.initialize`:
  38. - **host** - the hostname or IP of the HTTP proxy to use
  39. - **port** - the TCP port to use on that proxy
  40. - **connect** _(optional)_ controls what protocols use the `CONNECT` method. It
  41. has three possible values (strings):
  42. - **neither** - don't use `CONNECT`; just use absolute URIs
  43. - **https** - _(the default)_ only use `CONNECT` for HTTPS requests
  44. - **both** - use `CONNECT` for both HTTP and HTTPS requests
  45. - **protocol** - the protocol that the proxy speaks, either `http:` or `https:`.
  46. - **proxyAuth** - _(optional)_ to authenticate `userId:password`
  47. - **sockets** - _(optional)_ maximum number of TCP sockets to use in each pool.
  48. There are two pools: one for HTTP and one for HTTPS. Uses node's default (5)
  49. if falsy.
  50. ## Variations
  51. Here's a few interesting variations on the basic config.
  52. ### Absolute URI Proxies
  53. Another common proxy configuration is one that expects clients to use an
  54. [absolute URI for the
  55. Request-URI](https://tools.ietf.org/html/rfc2616#section-5.1.2) for all HTTP
  56. and HTTPS requests. This is common for networks that use a proxy for security
  57. scanning and access control.
  58. What does this mean? It means that instead of ...
  59. ```http
  60. GET / HTTP/1.1
  61. Host: example.com
  62. ```
  63. ... your proxy expects ...
  64. ```http
  65. GET https://example.com/ HTTP/1.1
  66. ```
  67. You'll need to specify `connect: 'neither'` if this is the case. If the proxy
  68. speaks HTTP (i.e. the connection from node --> proxy is not encrypted):
  69. ```js
  70. globalTunnel.initialize({
  71. connect: 'neither',
  72. host: '10.0.0.10',
  73. port: 3128
  74. });
  75. ```
  76. or, if the proxy speaks HTTPS to your app instead:
  77. ```js
  78. globalTunnel.initialize({
  79. connect: 'neither',
  80. protocol: 'https:',
  81. host: '10.0.0.10',
  82. port: 3129
  83. });
  84. ```
  85. ### Always-CONNECT Proxies
  86. If the proxy expects you to use the `CONNECT` method for both HTTP and HTTPS
  87. requests, you'll need the `connect: 'both'` option.
  88. What does this mean? It means that instead of ...
  89. ```http
  90. GET https://example.com/ HTTP/1.1
  91. ```
  92. ... your proxy expects ...
  93. ```http
  94. CONNECT example.com:443 HTTP/1.1
  95. ```
  96. Be sure to set the `protocol:` option based on what protocol the proxy speaks.
  97. ```js
  98. globalTunnel.initialize({
  99. connect: 'both',
  100. host: '10.0.0.10',
  101. port: 3130
  102. });
  103. ```
  104. ### HTTPS configuration
  105. _EXPERIMENTAL_
  106. If tunnelling both protocols, you can use different HTTPS client configurations
  107. for the two phases of the connection.
  108. ```js
  109. globalTunnel.initialize({
  110. connect: 'both',
  111. protocol: 'https:'
  112. host: '10.0.0.10',
  113. port: 3130,
  114. proxyHttpsOptions: {
  115. // use this config for app -> proxy
  116. },
  117. originHttpsOptions: {
  118. // use this config for proxy -> origin
  119. }
  120. });
  121. ```
  122. ## Auto-Config
  123. If `globalTunnel.initialize` doesnt receive a configuration as its first parameter the `http_proxys` and `http_proxy` environment variables will be used.
  124. If these are missing the npm configurations `https-proxy`, `http-proxy`, `proxy` will be used instead.
  125. If no environment variables or npm configurations are found nothing will be done.
  126. ## Retrieving proxy URL, parsed config and proxy status
  127. As the module does some extra job determining the proxy (including parsing the environment variables) and does some normalization (like defaulting the protocol to `http:`) it may be useful to retrieve the proxy URL used by the module.
  128. The property `globalTunnel.proxyUrl` is the URL-formatted (including the optional basic auth if provided) proxy config currently in use. It is `null` if the proxy is not currently enabled.
  129. Similarly, the `globalTunnel.proxyConfig` contains the entire parsed and normalized config.
  130. The property `globalTunnel.isProxying` contains the information about whether the global proxy is on or off.
  131. # Compatibility
  132. Any module that doesn't specify [an explicit `agent:` option to
  133. `http.request`](http://nodejs.org/docs/v0.10.24/api/all.html#all_http_request_options_callback)
  134. will also work with global-tunnel.
  135. The unit tests for this module verify that the popular [`request`
  136. module](https://npmjs.org/package/request) works with global-tunnel active.
  137. For untested modules, it's recommended that you load and initialize
  138. global-tunnel first. This way, any copies of `http.globalAgent` will point to
  139. the right thing.
  140. # Contributing
  141. If you'd like to contribute to or modify global-tunnel, here's a quick guide
  142. to get you started.
  143. ## Development Dependencies
  144. - [node.js](http://nodejs.org) >= 0.10
  145. ## Set-Up
  146. Download via GitHub and install npm dependencies:
  147. ```sh
  148. git clone git@github.com:np-maintain/global-tunnel.git
  149. cd global-tunnel
  150. npm install
  151. ```
  152. ## Testing
  153. Testing is with the [mocha](https://github.com/visionmedia/mocha) framework.
  154. Tests are located in the `test/` directory.
  155. To run the tests:
  156. ```sh
  157. npm test
  158. ```
  159. # Support
  160. As this is a hard fork, you may still contact the given contacts below.
  161. Email [GoInstant Support](mailto:support@goinstant.com) or stop by [#goinstant on freenode](irc://irc.freenode.net#goinstant).
  162. For responsible disclosures, email [GoInstant Security](mailto:security@goinstant.com).
  163. To [file a bug](https://github.com/np-maintain/global-tunnel/issues) or
  164. [propose a patch](https://github.com/np-maintain/global-tunnel/pulls),
  165. please use github directly.
  166. # Legal
  167. © 2014 GoInstant Inc., a salesforce.com company
  168. Licensed under the BSD 3-clause license.