• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

How to access a REST api deployed on tomcat from a different system on the network

 
Ranch Hand
Posts: 640
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
Is there any way I can access a REST api developed using spring-boot and deployed on embedded Tomcat, from a different system(mobile/pc) on the same network?
I tried below application.properties options, but they didn't help
 
Sheriff
Posts: 21759
102
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove server.address. That line tells Spring Boot to only listen on the local interface, which means that any request from any other machine will be rejected (connection refused).
 
Puspender Tanwar
Ranch Hand
Posts: 640
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Spoor wrote:Remove server.address. That line tells Spring Boot to only listen on the local interface, which means that any request from any other machine will be rejected (connection refused).

Earlier was not using these parameters, I wrote them after googling the issue
Anyway, I would need to get the local IP address of my system on the network. Now I can access that IP from other systems.
 
Rob Spoor
Sheriff
Posts: 21759
102
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
0.0.0.0 should allow you to connect from any machine to any interface. Its the generic "listen on all interfaces" IP address.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!