|
5 | 5 | HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a |
6 | 6 | separate module. |
7 | 7 |
|
| 8 | +## Class: https.Agent |
| 9 | + |
| 10 | +An Agent object for HTTPS similar to [http.Agent][]. See [https.request()][] |
| 11 | +for more information. |
| 12 | + |
8 | 13 | ## Class: https.Server |
9 | 14 |
|
10 | 15 | This class is a subclass of `tls.Server` and emits events same as |
|
54 | 59 | res.end("hello world\n"); |
55 | 60 | }).listen(8000); |
56 | 61 |
|
| 62 | +### server.close([callback]) |
| 63 | + |
| 64 | +See [http.close()][] for details. |
57 | 65 |
|
58 | | -### server.listen(port[, host][, backlog][, callback]) |
59 | | -### server.listen(path[, callback]) |
60 | 66 | ### server.listen(handle[, callback]) |
| 67 | +### server.listen(path[, callback]) |
| 68 | +### server.listen(port[, host][, backlog][, callback]) |
61 | 69 |
|
62 | 70 | See [http.listen()][] for details. |
63 | 71 |
|
64 | | -### server.close([callback]) |
| 72 | +## https.get(options, callback) |
65 | 73 |
|
66 | | -See [http.close()][] for details. |
| 74 | +Like `http.get()` but for HTTPS. |
| 75 | + |
| 76 | +`options` can be an object or a string. If `options` is a string, it is |
| 77 | +automatically parsed with [url.parse()](url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost). |
| 78 | + |
| 79 | +Example: |
| 80 | + |
| 81 | + var https = require('https'); |
| 82 | + |
| 83 | + https.get('https://encrypted.google.com/', function(res) { |
| 84 | + console.log("statusCode: ", res.statusCode); |
| 85 | + console.log("headers: ", res.headers); |
| 86 | + |
| 87 | + res.on('data', function(d) { |
| 88 | + process.stdout.write(d); |
| 89 | + }); |
| 90 | + |
| 91 | + }).on('error', function(e) { |
| 92 | + console.error(e); |
| 93 | + }); |
| 94 | + |
| 95 | +## https.globalAgent |
| 96 | + |
| 97 | +Global instance of [https.Agent][] for all HTTPS client requests. |
| 98 | + |
| 99 | +[http.Server#setTimeout()]: http.html#http_server_settimeout_msecs_callback |
| 100 | +[http.Server#timeout]: http.html#http_server_timeout |
| 101 | +[Agent]: #https_class_https_agent |
| 102 | +[globalAgent]: #https_https_globalagent |
| 103 | +[http.listen()]: http.html#http_server_listen_port_hostname_backlog_callback |
| 104 | +[http.close()]: http.html#http_server_close_callback |
| 105 | +[http.Agent]: http.html#http_class_http_agent |
| 106 | +[http.request()]: http.html#http_http_request_options_callback |
| 107 | +[https.Agent]: #https_class_https_agent |
| 108 | +[https.request()]: #https_https_request_options_callback |
| 109 | +[tls.connect()]: tls.html#tls_tls_connect_options_callback |
| 110 | +[tls.createServer()]: tls.html#tls_tls_createserver_options_secureconnectionlistener |
| 111 | +[SSL_METHODS]: http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_PROTOCOL_METHODS |
67 | 112 |
|
68 | 113 | ## https.request(options, callback) |
69 | 114 |
|
@@ -181,51 +226,3 @@ Example: |
181 | 226 | var req = https.request(options, function(res) { |
182 | 227 | ... |
183 | 228 | } |
184 | | - |
185 | | -## https.get(options, callback) |
186 | | - |
187 | | -Like `http.get()` but for HTTPS. |
188 | | - |
189 | | -`options` can be an object or a string. If `options` is a string, it is |
190 | | -automatically parsed with [url.parse()](url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost). |
191 | | - |
192 | | -Example: |
193 | | - |
194 | | - var https = require('https'); |
195 | | - |
196 | | - https.get('https://encrypted.google.com/', function(res) { |
197 | | - console.log("statusCode: ", res.statusCode); |
198 | | - console.log("headers: ", res.headers); |
199 | | - |
200 | | - res.on('data', function(d) { |
201 | | - process.stdout.write(d); |
202 | | - }); |
203 | | - |
204 | | - }).on('error', function(e) { |
205 | | - console.error(e); |
206 | | - }); |
207 | | - |
208 | | - |
209 | | -## Class: https.Agent |
210 | | - |
211 | | -An Agent object for HTTPS similar to [http.Agent][]. See [https.request()][] |
212 | | -for more information. |
213 | | - |
214 | | - |
215 | | -## https.globalAgent |
216 | | - |
217 | | -Global instance of [https.Agent][] for all HTTPS client requests. |
218 | | - |
219 | | -[http.Server#setTimeout()]: http.html#http_server_settimeout_msecs_callback |
220 | | -[http.Server#timeout]: http.html#http_server_timeout |
221 | | -[Agent]: #https_class_https_agent |
222 | | -[globalAgent]: #https_https_globalagent |
223 | | -[http.listen()]: http.html#http_server_listen_port_hostname_backlog_callback |
224 | | -[http.close()]: http.html#http_server_close_callback |
225 | | -[http.Agent]: http.html#http_class_http_agent |
226 | | -[http.request()]: http.html#http_http_request_options_callback |
227 | | -[https.Agent]: #https_class_https_agent |
228 | | -[https.request()]: #https_https_request_options_callback |
229 | | -[tls.connect()]: tls.html#tls_tls_connect_options_callback |
230 | | -[tls.createServer()]: tls.html#tls_tls_createserver_options_secureconnectionlistener |
231 | | -[SSL_METHODS]: http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_PROTOCOL_METHODS |
0 commit comments