-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: bump deps version and make test more stable
- Loading branch information
Showing
7 changed files
with
74 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
logo.png | ||
.travis.yml | ||
.drone.yml | ||
examples/ | ||
test/ | ||
Makefile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict'; | ||
|
||
var zlib = require('zlib'); | ||
var http = require('http'); | ||
var size = 0; | ||
|
||
var options = { | ||
method: 'GET', | ||
hostname: 'www.tmall.com', | ||
port: 80, | ||
path: '/go/market/promotion-act/shengxian1111_mobile.php', | ||
headers: { | ||
// 'Accept-Encoding': 'gzip' | ||
} | ||
}; | ||
|
||
http.request(options, function (res) { | ||
console.log(res.statusCode, res.headers); | ||
var chunks = []; | ||
res.on('data', function (data) { | ||
console.log('data size: %d', data.length); | ||
size += data.length; | ||
chunks.push(data); | ||
}).on('end', function () { | ||
console.log('response end: gzip %d', size); | ||
// console.log('response end: gzip %d, realsize: %d', size, zlib.gunzipSync(Buffer.concat(chunks)).length); | ||
}).on('close', function () { | ||
console.log('response close: %d', size); | ||
}).on('error', function (err) { | ||
console.log(err.stack); | ||
console.log('response error: %d', size); | ||
}); | ||
}).on('error', function (err) { | ||
console.log(err.stack); | ||
console.log('size: %s', size); | ||
}).end(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters