Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function login() {
- var o = JSON.stringify({
- username: username,
- password: password
- });
- var options = {
- hostname: 'roblox.com',
- port: 443,
- path: '/NewLogin',
- method: 'POST',
- headers: {
- 'Content-Length': Buffer.byteLength(dataJson),
- 'Content-Type': 'application/json'
- }
- };
- var req = https.request(options, function(rsp) {
- rsp.on('error', function(e) {
- console.log('Error!')
- login()
- return;
- })
- rsp.on('data', function() {
- console.log('Data received!')
- })
- rsp.on('end', function() {
- var setcookie = rsp.headers["set-cookie"];
- if (setcookie) {
- for (var p = 0; p < setcookie.length; p++) {
- if (setcookie[p].charAt(0) == '.') {
- RSec = setcookie[p].replace(/ *\_[^)]*\_ */g, "");
- RSec = RSec.substring(0, RSec.indexOf(';'));
- };
- };
- };
- });
- });
- req.on('error', function(e) {
- console.log('Error with login!');
- login()
- return;
- })
- req.write(dataJson);
- req.end();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement