Skip to content
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

url.parse is deprecated - Requests going to localhost #66

Open
tbenyon opened this issue Mar 2, 2021 · 0 comments
Open

url.parse is deprecated - Requests going to localhost #66

tbenyon opened this issue Mar 2, 2021 · 0 comments

Comments

@tbenyon
Copy link

tbenyon commented Mar 2, 2021

I found that url.parse being deprecated meant that the requests were going to localhost.

I had to modify that start of the postMessage() function to this:

var postMessage = function(message, callback) {
  var body = JSON.stringify(message);

  const urlObject = new url()

  let options = {
    hostname: urlObject.host,
    method: 'POST',
    path: urlObject.pathname,
    headers: {
      'Content-Type': 'application/json',
      'Content-Length': Buffer.byteLength(body),
    }
  };

  var postReq = https.request(options, function(res) {
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant