/    Sign up×
Community /Pin to ProfileBookmark

Problems hosting a server

Hi, this isn’t really a java question as such, but since the program I made is written in java I thought someone here would know how to help…

I’m having problems hosting a server on my computer – I’ve made a ServerSocket and made it bind to my ip address, but since I’m on a router, I think it’s binding to my local IP address instead of my router’s IP, so it won’t work over the internet.

I’ve heard I can forward ports from my router to my computer so that this will work, but I tried changing the NAT settings on my router so that the appropriate port was forwarded to my computer, but it doesn’t seem to work.

Does anyone know how I can fix this problem? I assume the answer would be more to do with my router than my code though.

to post a comment
Java

5 Comments(s)

Copy linkTweet thisAlerts:
@omnicityJan 04.2006 — Are you able to forward port 80 traffic, (or any other port for that matter) to your PC? If you can get that licked then you will be half-way there.

Alternatively, can you get a response from your app to another PC on the same network as you, ie behind the router?
Copy linkTweet thisAlerts:
@BigDogJan 04.2006 — well, if you are running both the server and client on your pc, just use the loopback address. You will know for sure that it is not a network problem then.
Copy linkTweet thisAlerts:
@agent_x91authorJan 04.2006 — yes omnicity, it works fine on the LAN, amongst the other computers on the router. And no, I don't seem to be able to forward port 80, which is why I thought it had to be a program caused by my router to begin with. Also, I tried getting someone else to host the server for me and it seemed to work fine over internet.

Anyone got any suggestions?
Copy linkTweet thisAlerts:
@WaylanderJan 05.2006 — It sounds like you've got it figured and I would agree with you, some routers can do dodgy stuff ive had some fairly intersting experiences with them. Re-configuring the router would be a fairly good option, I would also look it up to see if anyone else has had the same issue with your model.

All else fails I would suggest borrowing someone elses router and putting it into your network if it works you will have isolated the problem to that specific device or its configuration.

Waylander.
Copy linkTweet thisAlerts:
@agent_x91authorJan 05.2006 — Err, that's a little bit extreme. I'm pretty sure it's the device anyway, and I'm looking for a solution to the problem...
×

Success!

Help @agent_x91 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...