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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. # node-tunnel - HTTP/HTTPS Agents for tunneling proxies
  2. [![Build Status](https://img.shields.io/travis/koichik/node-tunnel.svg?style=flat)](https://travis-ci.org/koichik/node-tunnel)
  3. [![Dependency Status](http://img.shields.io/david/koichik/node-tunnel.svg?style=flat)](https://david-dm.org/koichik/node-tunnel#info=dependencies)
  4. [![DevDependency Status](http://img.shields.io/david/dev/koichik/node-tunnel.svg?style=flat)](https://david-dm.org/koichik/node-tunnel#info=devDependencies)
  5. ## Example
  6. ```javascript
  7. var tunnel = require('tunnel');
  8. var tunnelingAgent = tunnel.httpsOverHttp({
  9. proxy: {
  10. host: 'localhost',
  11. port: 3128
  12. }
  13. });
  14. var req = https.request({
  15. host: 'example.com',
  16. port: 443,
  17. agent: tunnelingAgent
  18. });
  19. ```
  20. ## Installation
  21. $ npm install tunnel
  22. ## Usages
  23. ### HTTP over HTTP tunneling
  24. ```javascript
  25. var tunnelingAgent = tunnel.httpOverHttp({
  26. maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
  27. proxy: { // Proxy settings
  28. host: proxyHost, // Defaults to 'localhost'
  29. port: proxyPort, // Defaults to 80
  30. localAddress: localAddress, // Local interface if necessary
  31. // Basic authorization for proxy server if necessary
  32. proxyAuth: 'user:password',
  33. // Header fields for proxy server if necessary
  34. headers: {
  35. 'User-Agent': 'Node'
  36. }
  37. }
  38. });
  39. var req = http.request({
  40. host: 'example.com',
  41. port: 80,
  42. agent: tunnelingAgent
  43. });
  44. ```
  45. ### HTTPS over HTTP tunneling
  46. ```javascript
  47. var tunnelingAgent = tunnel.httpsOverHttp({
  48. maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
  49. // CA for origin server if necessary
  50. ca: [ fs.readFileSync('origin-server-ca.pem')],
  51. // Client certification for origin server if necessary
  52. key: fs.readFileSync('origin-server-key.pem'),
  53. cert: fs.readFileSync('origin-server-cert.pem'),
  54. proxy: { // Proxy settings
  55. host: proxyHost, // Defaults to 'localhost'
  56. port: proxyPort, // Defaults to 80
  57. localAddress: localAddress, // Local interface if necessary
  58. // Basic authorization for proxy server if necessary
  59. proxyAuth: 'user:password',
  60. // Header fields for proxy server if necessary
  61. headers: {
  62. 'User-Agent': 'Node'
  63. },
  64. }
  65. });
  66. var req = https.request({
  67. host: 'example.com',
  68. port: 443,
  69. agent: tunnelingAgent
  70. });
  71. ```
  72. ### HTTP over HTTPS tunneling
  73. ```javascript
  74. var tunnelingAgent = tunnel.httpOverHttps({
  75. maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
  76. proxy: { // Proxy settings
  77. host: proxyHost, // Defaults to 'localhost'
  78. port: proxyPort, // Defaults to 443
  79. localAddress: localAddress, // Local interface if necessary
  80. // Basic authorization for proxy server if necessary
  81. proxyAuth: 'user:password',
  82. // Header fields for proxy server if necessary
  83. headers: {
  84. 'User-Agent': 'Node'
  85. },
  86. // CA for proxy server if necessary
  87. ca: [ fs.readFileSync('origin-server-ca.pem')],
  88. // Server name for verification if necessary
  89. servername: 'example.com',
  90. // Client certification for proxy server if necessary
  91. key: fs.readFileSync('origin-server-key.pem'),
  92. cert: fs.readFileSync('origin-server-cert.pem'),
  93. }
  94. });
  95. var req = http.request({
  96. host: 'example.com',
  97. port: 80,
  98. agent: tunnelingAgent
  99. });
  100. ```
  101. ### HTTPS over HTTPS tunneling
  102. ```javascript
  103. var tunnelingAgent = tunnel.httpsOverHttps({
  104. maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
  105. // CA for origin server if necessary
  106. ca: [ fs.readFileSync('origin-server-ca.pem')],
  107. // Client certification for origin server if necessary
  108. key: fs.readFileSync('origin-server-key.pem'),
  109. cert: fs.readFileSync('origin-server-cert.pem'),
  110. proxy: { // Proxy settings
  111. host: proxyHost, // Defaults to 'localhost'
  112. port: proxyPort, // Defaults to 443
  113. localAddress: localAddress, // Local interface if necessary
  114. // Basic authorization for proxy server if necessary
  115. proxyAuth: 'user:password',
  116. // Header fields for proxy server if necessary
  117. headers: {
  118. 'User-Agent': 'Node'
  119. }
  120. // CA for proxy server if necessary
  121. ca: [ fs.readFileSync('origin-server-ca.pem')],
  122. // Server name for verification if necessary
  123. servername: 'example.com',
  124. // Client certification for proxy server if necessary
  125. key: fs.readFileSync('origin-server-key.pem'),
  126. cert: fs.readFileSync('origin-server-cert.pem'),
  127. }
  128. });
  129. var req = https.request({
  130. host: 'example.com',
  131. port: 443,
  132. agent: tunnelingAgent
  133. });
  134. ```
  135. ## CONTRIBUTORS
  136. * [Aleksis Brezas (abresas)](https://github.com/abresas)
  137. * [Jackson Tian (JacksonTian)](https://github.com/JacksonTian)
  138. * [Dmitry Sorin (1999)](https://github.com/1999)
  139. ## License
  140. Licensed under the [MIT](https://github.com/koichik/node-tunnel/blob/master/LICENSE) license.