-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to use curl as a backend for HTTP(s) monitor #4534
Comments
Wireshark filter: pcap of the two requests: |
I think this is just a wrong usage of const http = require('http');
const options = {
hostname: 'blog.maple3142.net',
port: 80,
path: '/',
method: 'GET'
};
const req = http.request(options, (res) => {
console.log(`Status Code: ${res.statusCode}`);
console.log('Headers:');
console.log(res.headers);
// Buffer the response data
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
// When the whole response has been received
res.on('end', () => {
console.log('Response Body: '+ data);
});
});
req.on('error', (error) => {
console.error(`Error: ${error.message}`);
});
req.end(); |
I was having that problem on a vps running Debian 12. The problem seems to be magically fixed after a reboot so I can't reproduce it now.
Hmm, the only thing wrong with |
π I have found these related issues/pull requests
I can't find any related issue about adding curl as a monitor by searching
curl monitor
.π·οΈ Feature Request Type
Change to existing monitor
π Feature description
Currently, uptime-kuma appear to use axios for checking HTTP(s) monitor. I wish it is possible to use
curl
(usingchild_process
) as an alternative to that.βοΈ Solution
I think this can either be added as an option to the existing HTTP(s) monitors, or be its out new monitor type if it is hard to achieve feature parity with this.
β Alternatives
A more general "execute shell command and check its exit code" monitor would be good for this specific use case. (#1117)
π Additional Context
The reason I want this is because the native
http
in node.js keep giving meETIMEOUT
error when I want to reach certain websites (e.g. my blog), butcurl
works just fine.curl:
with node.js http:
even a raw netcat works just fine:
I am not sure why this happens, but being able to choose a different backend (e.g. curl) for making HTTP(s) requests would be a good way to solve this.
The text was updated successfully, but these errors were encountered: