Created
April 2, 2022 12:05
-
-
Save sudo-vaibhav/62244963b298106f87c06fd1895db9b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from "isomorphic-fetch" | |
const gap = 60 * 1000 | |
const username = "19BCE0932" | |
const password = "passwordHere" | |
const login = async () => { | |
const resp = await fetch("http://phc.prontonetworks.com/cgi-bin/authlogin?URI=http://nmcheck.gnome.org/", { | |
"headers": { | |
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", | |
"accept-language": "en-US,en;q=0.9", | |
"cache-control": "max-age=0", | |
"content-type": "application/x-www-form-urlencoded", | |
"upgrade-insecure-requests": "1", | |
"Referer": "http://phc.prontonetworks.com/cgi-bin/authlogin?URI=http://www.msftconnecttest.com/redirect", | |
"Referrer-Policy": "strict-origin-when-cross-origin" | |
}, | |
"body": `userId=${username}&password=${password}&serviceName=ProntoAuthentication&Submit22=Login`, | |
"method": "POST" | |
}); | |
const text = await resp.text() | |
console.log(text) | |
} | |
setInterval(async () => { | |
login() | |
}, gap) | |
const logout = async () => { | |
fetch("http://phc.prontonetworks.com/cgi-bin/authlogout", { | |
"headers": { | |
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", | |
"accept-language": "en-US,en;q=0.9", | |
"upgrade-insecure-requests": "1", | |
"Referer": "http://phc.prontonetworks.com/cgi-bin/authlogin?URI=http://nmcheck.gnome.org/", | |
"Referrer-Policy": "strict-origin-when-cross-origin" | |
}, | |
"body": null, | |
"method": "GET" | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment