2017-01-04 05:16:48 +08:00
|
|
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
// copy of this software and associated documentation files (the
|
|
|
|
// "Software"), to deal in the Software without restriction, including
|
|
|
|
// without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
|
|
// persons to whom the Software is furnished to do so, subject to the
|
|
|
|
// following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included
|
|
|
|
// in all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
|
|
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
|
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
|
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
|
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
2015-05-19 19:00:06 +08:00
|
|
|
'use strict';
|
2016-12-31 07:38:06 +08:00
|
|
|
const common = require('../common');
|
2017-10-23 02:07:54 +08:00
|
|
|
const { addresses } = require('../common/internet');
|
2013-08-04 14:39:50 +08:00
|
|
|
|
2017-07-01 07:29:09 +08:00
|
|
|
if (!common.hasCrypto)
|
2016-05-12 03:34:52 +08:00
|
|
|
common.skip('missing crypto');
|
2017-07-01 07:29:09 +08:00
|
|
|
|
2016-12-31 07:38:06 +08:00
|
|
|
const https = require('https');
|
2015-03-04 09:11:21 +08:00
|
|
|
|
2016-12-31 07:38:06 +08:00
|
|
|
const http = require('http');
|
2013-08-04 14:39:50 +08:00
|
|
|
|
2018-03-04 20:12:03 +08:00
|
|
|
https.get(`https://${addresses.INET_HOST}/`, common.mustCall((res) => {
|
2013-08-04 14:39:50 +08:00
|
|
|
res.resume();
|
2016-07-16 03:43:24 +08:00
|
|
|
}));
|
2013-08-04 14:39:50 +08:00
|
|
|
|
2018-03-04 20:12:03 +08:00
|
|
|
http.get(`http://${addresses.INET_HOST}/`, common.mustCall((res) => {
|
2013-08-04 14:39:50 +08:00
|
|
|
res.resume();
|
2016-07-16 03:43:24 +08:00
|
|
|
}));
|