0

I try to send HTTP request from my Iphone to local server that run on my local network (behind a router). I forwarded the port on my router as follow:enter image description here

HTTP request is :

 NSMutableURLRequest * request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://213.57.x.x:8080/OurDogsServerV2/DoggizzMain"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setAllowsCellularAccess:YES];

Over Wifi everything is working fine but I want to test 3G network (for end user). I set a break point on doPost at my server (Apachi) so I don't think its time interval problem because I don't even get to my BP.

(I disabled my firewall).

I tried to change the url to http://213.57.x.x:8080/localhost:8080/OurDogsServerV2/ and some other combinations.

Can somebody suggest what else can I try?

Binarian
  • 12,296
  • 8
  • 53
  • 84
Mike.R
  • 2,824
  • 2
  • 26
  • 34
  • you are able to browse to http://213.57.x.x:8080/ with safari over 3g? – Manuel van Rijn May 27 '14 at 19:42
  • Manuel van Rijn :I can access my Apachi page only when I turn on Wifi but not with 3G, I think its because I still remain in local network when I turn the Wifi.Tnx. – Mike.R May 27 '14 at 20:04
  • 1
    I thought so two. A quick tip, you might want to take a look at https://ngrok.com/. You can do something like ngrok 8080 which will create a public url, tunneling traffic to your machine's port 8080 – Manuel van Rijn May 27 '14 at 21:43

1 Answers1

0

It was totally my fault. In the options of my router I did disable the WAN Blocking but I didn't notice the apply button in the bottom (I think I assumed that apply button for port forwarding will include that option).

Mike.R
  • 2,824
  • 2
  • 26
  • 34