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 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. https-proxy-agent
  2. ================
  3. ### An HTTP(s) proxy `http.Agent` implementation for HTTPS
  4. [![Build Status](https://github.com/TooTallNate/node-https-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-https-proxy-agent/actions?workflow=Node+CI)
  5. This module provides an `http.Agent` implementation that connects to a specified
  6. HTTP or HTTPS proxy server, and can be used with the built-in `https` module.
  7. Specifically, this `Agent` implementation connects to an intermediary "proxy"
  8. server and issues the [CONNECT HTTP method][CONNECT], which tells the proxy to
  9. open a direct TCP connection to the destination server.
  10. Since this agent implements the CONNECT HTTP method, it also works with other
  11. protocols that use this method when connecting over proxies (i.e. WebSockets).
  12. See the "Examples" section below for more.
  13. Installation
  14. ------------
  15. Install with `npm`:
  16. ``` bash
  17. $ npm install https-proxy-agent
  18. ```
  19. Examples
  20. --------
  21. #### `https` module example
  22. ``` js
  23. var url = require('url');
  24. var https = require('https');
  25. var HttpsProxyAgent = require('https-proxy-agent');
  26. // HTTP/HTTPS proxy to connect to
  27. var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
  28. console.log('using proxy server %j', proxy);
  29. // HTTPS endpoint for the proxy to connect to
  30. var endpoint = process.argv[2] || 'https://graph.facebook.com/tootallnate';
  31. console.log('attempting to GET %j', endpoint);
  32. var options = url.parse(endpoint);
  33. // create an instance of the `HttpsProxyAgent` class with the proxy server information
  34. var agent = new HttpsProxyAgent(proxy);
  35. options.agent = agent;
  36. https.get(options, function (res) {
  37. console.log('"response" event!', res.headers);
  38. res.pipe(process.stdout);
  39. });
  40. ```
  41. #### `ws` WebSocket connection example
  42. ``` js
  43. var url = require('url');
  44. var WebSocket = require('ws');
  45. var HttpsProxyAgent = require('https-proxy-agent');
  46. // HTTP/HTTPS proxy to connect to
  47. var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
  48. console.log('using proxy server %j', proxy);
  49. // WebSocket endpoint for the proxy to connect to
  50. var endpoint = process.argv[2] || 'ws://echo.websocket.org';
  51. var parsed = url.parse(endpoint);
  52. console.log('attempting to connect to WebSocket %j', endpoint);
  53. // create an instance of the `HttpsProxyAgent` class with the proxy server information
  54. var options = url.parse(proxy);
  55. var agent = new HttpsProxyAgent(options);
  56. // finally, initiate the WebSocket connection
  57. var socket = new WebSocket(endpoint, { agent: agent });
  58. socket.on('open', function () {
  59. console.log('"open" event!');
  60. socket.send('hello world');
  61. });
  62. socket.on('message', function (data, flags) {
  63. console.log('"message" event! %j %j', data, flags);
  64. socket.close();
  65. });
  66. ```
  67. API
  68. ---
  69. ### new HttpsProxyAgent(Object options)
  70. The `HttpsProxyAgent` class implements an `http.Agent` subclass that connects
  71. to the specified "HTTP(s) proxy server" in order to proxy HTTPS and/or WebSocket
  72. requests. This is achieved by using the [HTTP `CONNECT` method][CONNECT].
  73. The `options` argument may either be a string URI of the proxy server to use, or an
  74. "options" object with more specific properties:
  75. * `host` - String - Proxy host to connect to (may use `hostname` as well). Required.
  76. * `port` - Number - Proxy port to connect to. Required.
  77. * `protocol` - String - If `https:`, then use TLS to connect to the proxy.
  78. * `headers` - Object - Additional HTTP headers to be sent on the HTTP CONNECT method.
  79. * Any other options given are passed to the `net.connect()`/`tls.connect()` functions.
  80. License
  81. -------
  82. (The MIT License)
  83. Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
  84. Permission is hereby granted, free of charge, to any person obtaining
  85. a copy of this software and associated documentation files (the
  86. 'Software'), to deal in the Software without restriction, including
  87. without limitation the rights to use, copy, modify, merge, publish,
  88. distribute, sublicense, and/or sell copies of the Software, and to
  89. permit persons to whom the Software is furnished to do so, subject to
  90. the following conditions:
  91. The above copyright notice and this permission notice shall be
  92. included in all copies or substantial portions of the Software.
  93. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  94. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  95. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  96. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  97. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  98. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  99. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  100. [CONNECT]: http://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_Tunneling