Advertisement
Guest User

Untitled

a guest
May 13th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. function login() {
  2. var o = JSON.stringify({
  3. username: username,
  4. password: password
  5. });
  6. var options = {
  7. hostname: 'roblox.com',
  8. port: 443,
  9. path: '/NewLogin',
  10. method: 'POST',
  11. headers: {
  12. 'Content-Length': Buffer.byteLength(dataJson),
  13. 'Content-Type': 'application/json'
  14. }
  15. };
  16. var req = https.request(options, function(rsp) {
  17. rsp.on('error', function(e) {
  18. console.log('Error!')
  19. login()
  20. return;
  21. })
  22. rsp.on('data', function() {
  23. console.log('Data received!')
  24. })
  25. rsp.on('end', function() {
  26. var setcookie = rsp.headers["set-cookie"];
  27. if (setcookie) {
  28. for (var p = 0; p < setcookie.length; p++) {
  29. if (setcookie[p].charAt(0) == '.') {
  30. RSec = setcookie[p].replace(/ *\_[^)]*\_ */g, "");
  31. RSec = RSec.substring(0, RSec.indexOf(';'));
  32. };
  33. };
  34. };
  35. });
  36. });
  37. req.on('error', function(e) {
  38. console.log('Error with login!');
  39. login()
  40. return;
  41. })
  42. req.write(dataJson);
  43. req.end();
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement