How connect to a Computer Hosting the VertX Server on the same LAN?

140 views
Skip to first unread message

dansol obondo

unread,
Jun 3, 2018, 1:56:50 PM6/3/18
to vert.x

Hi,

I am new to VertX. I have installed it on my computer, created a VertX project that uses the HTTPServer which has been bound to a port 8080. When i start the server using the command mvn compile vertx:run. And type http://localhost:8080 on my web browser it works.

The issue is when i place a computer or mobile device in the same network as the server and type in http://<serverIPAddressPlacedHere>:8080 no connection is made. it keeps telling me the unreachable. ERR_ADDRESS_UNREACHABLE

So how do i access my vertx HTTP server from another device in the same network?

Here is my code:

JsonObject mongoconfig = new JsonObject()
.put("connection_string", "mongodb://localhost:27017")
.put("db_name", "database_name")
.put("username", mongoDBUser)
.put("password", mongoDBpassword);
mongoClient = MongoClient.createShared(vertx, mongoconfig);


Router mRouter = Router.router(vertx);
mRouter.get().handler(this::base);
this.vertx.createHttpServer().requestHandler(mRouter::accept).listen(8080);
Message has been deleted

dansol obondo

unread,
Jun 3, 2018, 4:35:06 PM6/3/18
to vert.x
like how?...where do i bind the sever...
give me an example using the code i pasted

dansol obondo

unread,
Jun 3, 2018, 4:35:51 PM6/3/18
to ve...@googlegroups.com
like how?...where do i bind the sever...
give me an example using the code i pasted

Kind Regards,
Otieno, Dansol Obondo.

On Sun, Jun 3, 2018 at 10:57 PM, Hesbon Kiptoo <kiptoo...@ekenya.co.ke> wrote:
Use real IP when binding the server. 
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/96d8bb0d-f6e5-4edb-8e86-bb37fa5a224f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Hesbon K. Kiptoo 
Head, Research and Product Development
Eclectics International Limited, 3rd Floor, Utumishi House, Mamlaka Road

Inline image 1

"Do one thing and do it well", UNIX Philosophy.




--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/CAFTftzaPVWbdycqG8mbMWmRf6GL2uNc7biVoL%3D1svj868oLBYQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Jack Park

unread,
Jun 3, 2018, 4:41:13 PM6/3/18
to ve...@googlegroups.com
I am trying to understand this question, and end up with this thought:

Go to the computer which is the server and in a console type ipconfig or ifconfig and see what IP it's on, for instance 192.145.89.12 (just made that up). Now, if it's not blocked by a firewall, you should be able, on the same network, to pull up http://192.145.89.12:8080/

Or maybe I don't understand the question.

-Jack

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.

dansol obondo

unread,
Jun 3, 2018, 4:46:45 PM6/3/18
to ve...@googlegroups.com
Yes it is exactly what i am trying to do. The IP is not blocked by the firewall because when i run Wamp a can access it on another computer on the same network by pulling up http://192.145.89.12/

Kind Regards,
Otieno, Dansol Obondo.

dansol obondo

unread,
Jun 3, 2018, 4:47:03 PM6/3/18
to vert.x
Yes it is exactly what i am trying to do. The IP is not blocked by the firewall because when i run Wamp I can access it on another computer on the same network by pulling up http://192.145.89.12/
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Message has been deleted

Ger-Jan

unread,
Jun 4, 2018, 3:26:17 AM6/4/18
to ve...@googlegroups.com
> this.vertx.createHttpServer().requestHandler(mRouter::accept).listen(8080,192.145.89.12);

AFAIK this will not compile; the 2nd argument should be the IP address as a String [1].

However the original code ought to bind the server to all addresses as it uses the catch-all "0.0.0.0" [2]. Could something else be blocking access to the host?

Regards,

GJ

Like listen(int, String) but the server will listen on host "0.0.0.0" and port specified here ignoring any value in the HttpServerOptions that was used when creating the server.

On Mon, 4 Jun 2018 at 08:06, Hesbon Kiptoo <kiptoo...@ekenya.co.ke> wrote:
this.vertx.createHttpServer().requestHandler(mRouter::accept).listen(8080,192.145.89.12);


Hesbon K. Kiptoo 
Head, Research and Product Development
Eclectics International Limited, 3rd Floor, Utumishi House, Mamlaka Road

Inline image 1

"Do one thing and do it well", UNIX Philosophy.




--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.

dansol obondo

unread,
Jun 4, 2018, 7:16:50 PM6/4/18
to vert.x
This has too failed to work


On Monday, June 4, 2018 at 9:06:04 AM UTC+3, Hesbon Kiptoo wrote:
this.vertx.createHttpServer().requestHandler(mRouter::accept).listen(8080,192.145.89.12);


Hesbon K. Kiptoo 
Head, Research and Product Development
Eclectics International Limited, 3rd Floor, Utumishi House, Mamlaka Road

Inline image 1

"Do one thing and do it well", UNIX Philosophy.




On Sun, Jun 3, 2018 at 11:35 PM, dansol obondo <dansol...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.

Jez P

unread,
Jun 5, 2018, 5:42:29 AM6/5/18
to vert.x
What port does Wamp run on? I think you've ruled out the firewall without validating that in fact you haven't firewalled port 8080. 

dansol obondo

unread,
Jun 5, 2018, 5:50:11 AM6/5/18
to vert.x
IT is running on port 80.....how do i check if port 8080 is blocked by the firewall? and how do i unblock it?

Jez P

unread,
Jun 5, 2018, 6:34:41 AM6/5/18
to vert.x
Why not try binding your vertx server to port 80, and stopping wamp as a simple test experiment? If you can see your vertx service on port 80, then it's a firewall problem, and you should be able to google for a solution.

dansol obondo

unread,
Jun 5, 2018, 6:45:56 AM6/5/18
to vert.x
I have tried binding to port 80. It is still not working; cannot be accessed form another device within the same LAN.

Thomas SEGISMONT

unread,
Jun 5, 2018, 9:12:47 AM6/5/18
to ve...@googlegroups.com
It's probably not working on port 80 because you can't bind to a system port in user mode. You didn't see the exception because the listen method doesn't have a handler for the result.

The default host is 0.0.0.0 meaning, listening on all interfaces. So need to provide the machine IP.

I suspect your firewall simply doesn't let you reach the machine, that's all.

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.

Jez P

unread,
Jun 5, 2018, 9:55:36 AM6/5/18
to vert.x
Can you log into the server and use curl to the specified ip address/port? 

If curl works on the server, then it's almost certainly your network configs somewhere, and not vertx. 
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.

dansol obondo

unread,
Jun 5, 2018, 12:46:33 PM6/5/18
to vert.x
Thank you everyone for your help...it was an issue with my network firewall i had set is as public...i set it back to private network...it works fine now


On Sunday, June 3, 2018 at 8:56:50 PM UTC+3, dansol obondo wrote:
Reply all
Reply to author
Forward
0 new messages