question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Listening on more than one hostname or IP address

See original GitHub issue

Hello,

I tried the following on windows 10 and ran as administrator:

server = new WatsonWsServer("127.0.0.1+host1", 8081, false);

But this does not work. Could you share an example of listening on more than one host/ip ?

Thank you very much, Jules

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jchristncommented, Oct 15, 2021

Just uploaded a new version containing a constructor that supports multiple listener prefixes. Please re-open if any issues!

NuGet: https://www.nuget.org/packages/WatsonWebsocket/2.3.2 Commit: https://github.com/jchristn/WatsonWebsocket/commit/7944cfbdd5fa4af291cdb8369897cf23b1916ca3

List<string> hostnames = new List<string>
{
  "192.168.1.163",
  "127.0.0.1"
};

WatsonWsServer server = new WatsonWsServer(hostnames, 8000, false);

Cheers, Joel

0reactions
jchristncommented, Oct 14, 2021

Hi @SieBrum

Does this mean that the README.md is incorrect?

I may have misinterpreted the question, and this certainly is a way to achieve the same goal.

  1. If you want to be explicit about on which prefixes you listen, the library will need to be modified. The substrate under the library supports listening on “localhost:8000”, “192.168.1.143:8000”, etc, when those prefixes are discrete, but the library does not currently
  2. You absolutely can set your listener hostname to *, +, or 0.0.0.0 (OS dependent) to listen on anything. I do this all the time, just generally not in production, because it requires running as administrator.

Cheers, Joel

Read more comments on GitHub >

github_iconTop Results From Across the Web

what is it like that a host name is resolvable to more than ...
1 ) A hostname can be resolved to more than one IP address; this is called DNS round robin and can be used...
Read more >
c# - How to listen on multiple IP addresses?
As others have said, you can use IPAddress.Any to listen to the IPv4 addresses on the local machine. However, if you only want...
Read more >
How can I have SQL Server listening on more than one IP ...
Keep in mind that having an active listener on a public connection is asking for trouble, best to do it over a VPN,...
Read more >
What are the potential risks of binding an application to ...
If your service listens on more than one port, an attacker can do MITM attack on it, and perform traffic spoofing/injection/modification (this ...
Read more >
Can multiple dynamic DNS resolve to the same IP address
You can certainly have multiple domains/hostnames in DNS that resolve to the same IP address. However, whether you can differentiate this ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found