-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.js
39 lines (34 loc) · 833 Bytes
/
client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*const https = require("https");
// Sample URL
for (let i = 0; i < 100; i++) {
const url = "http://127.0.0.1:9001?&get&msegs." + i;
const request = https.request(url, (response) => {
let data = "";
response.on("data", (chunk) => {
data = data + chunk.toString();
});
response.on("end", () => {
console.log(data);
});
});
request.on("error", (error) => {
console.log("An error", error);
});
request.end();
}
*/
const https = require("https");
async function a() {
https
.get("https://pocketchat.fireship.app", function (res) {
console.log(res.statusCode);
res.setEncoding("utf8");
res.on("data", function (data) {
console.log(data.charAt(0));
});
})
.on("error", function (err) {
console.log(err);
});
}
setInterval(a, 50);