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 7988575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:29:46+00:00 2026-06-04T12:29:46+00:00

When 127.0.0.1 below is omitted app.address() is not null, but when a host is

  • 0

When 127.0.0.1 below is omitted app.address() is not null, but when a host is set, it is null.

var express = require('express'),
    app = express.createServer();

app.use(express.logger());

app.get('/', function(req, res){
    res.send('Hello World');
});

app.listen(3000, '127.0.0.1');
console.log(app.address());
console.log('Express server started on port %s', app.address().port);

Error output: TypeError: Cannot read property 'port' of null

Node v0.6.5

I installed express version 2.5.9 – its returning that I have installed 2.5.8 – not sure what that is about.

  • 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-04T12:29:48+00:00Added an answer on June 4, 2026 at 12:29 pm

    Because, app.address() is inherited from Node’s HTTP module. If you look to the documentation there writes:

    Returns the bound address and port of the server as reported by the
    operating system.

    Therefore I assume, when you request a port with an IP, the OS does not report it back to you, so this method returns null. However, when you don’t, you may need the IP or address of your computer, since every computer does not have to be “localhost”, they can have different domains allow you to only bind sockets to that domain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used to use the function below for an array or IP's but now
i try to get some data via WCF. İ created below app.config. But i
I can use the below to get the query string. var query_string = request.query;
http://mydomain.com/ => 127.0.0.1:4567 but http://mydomain.com/FOO => 127.0.0.1:3000 Is that possible? So far I have:
i'm using this rule for rewriting subdomain and i'm corrected host file to 127.0.0.1
I am trying to install capybara-webkit (0.8.0), but I get the error below, can
The config below seemed to have worked but now its failing. I followed this
On Sunos netstat -in gives me below output. Name Mtu Net/Dest Address Ipkts Ierrs
The code below aims at making TCP Server and Clients. But when the number
I followed below tutorial and built one whole complete app. http://www.tonyamoyal.com/2010/07/28/rails-authentication-with-devise-and-cancan-customizing-devise-controllers/ http://www.tonyamoyal.com/2010/09/29/rails-authentication-with-devise-and-cancan-part-2-restful-resources-for-administrators/comment-page-2/#comment-879 All is

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.