Problem getting connected.

60 views
Skip to first unread message

nowaik...@googlemail.com

unread,
May 23, 2013, 5:44:08 AM5/23/13
to web...@googlegroups.com
Hi everyone,

I'm new to all of this and I'm struggling to get my server up and running. I'm using Webbit 0.4.15 with Netty 3.6.6 Final. I copied the example code provided in the Git Wiki. It works flawlessly locally, but when I run it on my linux server I can't seem to connect. My server is running Debian 6.
What do I need to do / configure in order to get it up and running?

Neil Dunn

unread,
May 23, 2013, 5:44:57 AM5/23/13
to web...@googlegroups.com
Does you server have multiple network interfaces? It could be binding
to the wrong nic
> --
> You received this message because you are subscribed to the Google Groups
> "Webbit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to webbit+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

nowaik...@googlemail.com

unread,
May 23, 2013, 5:56:27 AM5/23/13
to web...@googlegroups.com
Hi, what do you mean with multiple network interfaces? How can I check the nic binding?

aslak hellesoy

unread,
May 23, 2013, 10:46:27 AM5/23/13
to Webbit
On Thu, May 23, 2013 at 4:56 AM, <nowaik...@googlemail.com> wrote:
Hi, what do you mean with multiple network interfaces? How can I check the nic binding?


WebServers.createWebServer(int port) binds to localhost[1] - also known as the loopback interface. That also means it will only accept connections from the same host.
If you want to allow connections from a different host you have to bind to a network interface instead. In other words, you need to bind to an explicit IP address.

You can discover these with the ifconfig command line tool (typically under /sbin/ifconfig).

Try this instead:

        String hostOrIp = "0.0.0.0"; // 0.0.0.0 binds to all NICs including localhost. Use a specific IP to narrow it down.
        int port = 8090;
        WebServer webServer = WebServers.createWebServer(Executors.newSingleThreadExecutor(), new InetSocketAddress(hostOrIp, port), URI.create(String.format("http://%s:%d", hostOrIp, port)))
 
Reply all
Reply to author
Forward
0 new messages