41 lines
791 B
JavaScript
Executable File
41 lines
791 B
JavaScript
Executable File
'use strict';
|
|
|
|
const fetch = require('node-fetch');
|
|
const express = require('express');
|
|
|
|
async function init() {
|
|
const res = await fetch('https://www.realitykings.com/scenes?site=45', {
|
|
method: 'HEAD',
|
|
headers: {
|
|
'user-agent': 'HTTPie/2.6.0',
|
|
'accept-encoding': 'gzip, deflate, br',
|
|
accept: '*/*',
|
|
connection: 'keep-alive',
|
|
},
|
|
});
|
|
|
|
console.log(res.status, res.headers);
|
|
|
|
const app = express();
|
|
|
|
app.get('/', (appReq, appRes) => {
|
|
console.log(appReq.headers);
|
|
appRes.status(204).send();
|
|
});
|
|
|
|
app.listen(8000, () => {
|
|
console.log('Listening on port 8000');
|
|
|
|
fetch('http://127.0.0.1:8000', {
|
|
headers: {
|
|
'user-agent': 'HTTPie/2.6.0',
|
|
'accept-encoding': 'gzip, deflate, br',
|
|
accept: '*/*',
|
|
connection: 'keep-alive',
|
|
},
|
|
});
|
|
});
|
|
}
|
|
|
|
init();
|