PGM_DEV PGM_DEV - 1 year ago 133
Node.js Question

Login with Node.js

I want to do a POST action with node.js with a command line application.
The goal is to login to
(I want to create a application that post the username and the password automaticly)
thanks ;)

Answer Source

If the website supports posting data to the login and receiving a login cookie/token back, you can use the following code:

var cloudscraper = require('cloudscraper');'', {
    username: 'username',
    password: 'password'
}, function(error, response, body) {
    if (error) {
        console.log("an error has occured");
    } else {
        console.log(body, response);

This code will simply send a POST method to while bypassing their CloudFlare DDOS protection and send a username and password along with the request.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download