[
'OPTIONS', 'post', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'TRACE', 'CONNECT', 'hui'
].forEach(method => {
try {
const req = new XMLHttpRequest()
req.onload = console.dir
req.open(method, '/')
req.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
req.send(JSON.stringify({
method
}))
} catch (er) {
console.error('disallow', method)
}
})
socket.setTimeout(3000);
socket.on('timeout', () => {
console.log('socket timeout');
socket.end();
});