Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8704563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:08:15+00:00 2026-06-13T03:08:15+00:00

I have two node servers, one on port 5000 (call it Face) and another

  • 0

I have two node servers, one on port 5000 (call it “Face”) and another on port 5001 (call it “Hands”)

Both are started via a foreman procfile at the same time. Ports are fixed and the url I’m targeting works in the browser.

When the Hands starts up, it needs to talk to the Face (Facepalm?) and register itself. However, the below code doesn’t seem to be working. (This is coffeescript generated JS)

Register gets called during server initialization, after the http server has been started. In case it was a timing issue, I kick off the register function with a setTimeout() of 2 seconds. I know the page that its hitting (/home/register) is available and working.

Right now I can see it get to the “Posting to” console log line. On the Face I have put a console.log in the register code and its never logging anything – meaning I don’t think its actually getting hit. (It DOES log if hit from browser) And nothing errors out – it just calls the request and then wanders off to get a sandwich.

Both servers are “roll your own” – not using any frameworks. Let me know if you see a weird typo or need more info. Thanks!

register = function() {
    var _this = this;
    console.log('Registering with Face Server');
    return post_face('/home/register', GLOBAL.data, function(rs) {
      console.log(rs);
      if (rs.registered) {
        GLOBAL.data.registered = true;
        return console.log("Registered with face at " + GLOBAL.config.face_host + ":" + GLOBAL.config.face_port);
      } else {
        throw "ERROR: Could not register with face server! " + GLOBAL.config.face_host + ":" + GLOBAL.config.face_port;
        return false;
      }
    });
  };

  post_face = function(path, data, cb) {
    var post_data, post_options, post_req;
    post_data = querystring.stringify({
      'registration': data
    });
    post_options = {
      host: GLOBAL.config.face_host,
      port: GLOBAL.config.face_port,
      path: path,
      method: 'POST',
      headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Content-Length': post_data.length
      }
    };
    console.log("Posting to " + post_options.host + ":" + post_options.port);
    post_req = http.request(post_options, function(res) {
      var response,
        _this = this;
      console.log(res);
      response = "";
      res.setEncoding('utf8');
      res.on('data', function(chunk) {
        return response += chunk;
      });
      return res.on('end', function() {
        return cb.call(_this, response);
      });
    });
    return true;
  };
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:08:16+00:00Added an answer on June 13, 2026 at 3:08 am

    Thanks to Bill above, the answer was that I wasn’t actually posting the data and ending the request! Bad copy / paste / edit from some samples I was referring to. Here’s the last two lines of code I should have had:

    post_req.write(post_data);
    post_req.end();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two erlang nodes running in two different computers, in one node I
I have node.js installed on one server. I have graphicsmagick https://github.com/aheckmann/gm installed on another
So I have two tables structured like so: CREATE TABLE #nodes(node int NOT NULL);
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have two classes (MVC view model) which inherits from one abstract base class.
I have two update panels on a page. And I want to update both
I have two lists, one on the right and one on the left. When
I have two separate installs of WebSphere. (Actually one is WebSphere Application Server V6.1
I'm trying to configure glassfish to use clusters. I have created node agent, two
I have two VM servers (A&B) loaded with SQL server. I have connected to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.