Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 19
Registered: ‎06-14-2011
My Device: 9300
My Carrier: Comcel
Accepted Solution

Domain access permissions for local network IPs

It is a feature restriction or an error that if I add "*" to avoid domain access restrictions on my app it only works on public IPs and doesn't with local network IPs?

 

(ie. over wifi my phone has 192.16.1.116 and is trying to access information on a pc with 192.16.1.119, result: timeout)

 

If the same request is made to a public IP (same pc) ie. 200.31.90.37 then it works as expected.

 

NOTE:

- This access request is made by a webworks app installed on the phone. the response is in JSONP format.

- PC Firewall disabled.

 

Failed tests

- Tests made over wifi accessing a local network IP with phone data service enabled and disabled 

 

Successful tests

- Tests made over Internet accessing a public IP, same phone, same app.

 

As shown in the following link, there is no indication that this behavior is expected:

 

http://docs.blackberry.com/en/developers/deliverables/27280/Allowing_access_to_external_resources_an...

 

If anybody knows a working example where "*" works for local network IPs please let me know.

 

Regards,

Contributor
Posts: 19
Registered: ‎06-14-2011
My Device: 9300
My Carrier: Comcel

Re: Domain access permissions for local network IPs

BUMP!  Smiley Sad

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Domain access permissions for local network IPs

astericks "*" for domains will allow access to any domain, whether it is on a local LAN or a public IP address.  Some WiFi networks are setup so that they do not allow peer-to-peer connections.  Not sure if this is your case or not.  

 

Also, I've seen web server configurations where they listen to a specifc IP address (public address) instead of the local LAN address and will not serve up data.

 

Not sure if either of these are the case...

 

Is your device BES (Corporate BlackBerry Enterprise Server) activated or BIS consumer activated?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 19
Registered: ‎06-14-2011
My Device: 9300
My Carrier: Comcel

Re: Domain access permissions for local network IPs

Thanks for the repply, it is a BIS activated phone, i have try it in different wifi networks, it is extrange that using the app as a web page it doesn't get any restrictions (LAN or Public IPs) when requesting info over ajax/JSONP, but as soon as is installed on the phone the behavior changes and can't access LAN IPs.
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Domain access permissions for local network IPs

ok... sit tight for this possible explaination Smiley Happy

 

A BlackBerry has two different concepts to consider:

1) Physical Network Connection

2) Transport Selection

 

The Physical Network Connection is pretty self explainatory (wifi, bluetooth, GPRS, CDMA).  The Transport Selection can best be thought of as a VPN Tunnel/Connection.  These Transports can be BES, BIS, TCP Direct, WAP gateway etc. 

 

Even though you are on WiFi, you can still have your transport (VPN) connected through BIS.  This is configured through your application settings.

 

The browser starting on BB6 uses a special transport (not available to apps) that basically does the equivalent of a DNS lookup and follows logic to see how the endpoint can be accessed.  It will then route over the transport that will get to its endpoint.

 

So in the browser, it is detecting that your IP address isn't public and re-routing over the direct TCP/IP connection to go directly to your local server.

 

In a BlackBerry App you must declare your transport order list which it will try and failover to the next if it can't be reached on the first transport.

 

In a WebWorks application the default transport order is BES, BIS-B, TCP_WIFI, TCP_CELLULAR, WAP2, WAP

 

More info on the transport in WebWorks here:

http://docs.blackberry.com/en/developers/deliverables/27261/Widget_element_834671_11.jsp#RIM_connect...

 

In your case, you would have to change the order of put TCP_WIFI first.  WARNING: Different transports have different failover times.  BIS-B and BES will instantly failover if they are not activated with that service. TCP_WIFI will actually do a connection timeout before failing over.  So if you don't have a WiFi connection it will timeout on each resource request before it then tries BIS-B.

 

So it comes down to what you want your application to be able to do.  If it is going to access public IPs then you will want to keep the default transport order.  If you want it to be able to discover both local and public IPs then you'll have a bit more work to do.

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 19
Registered: ‎06-14-2011
My Device: 9300
My Carrier: Comcel

Re: Domain access permissions for local network IPs

Tim! thanks man, that was the answer Smiley Happy, just changed the transport order. I am thinking about playing with the transport order and timeout value for each request to cover failover:

 

config Transport order

 

TCP WIFI

TCP Cellular

MDS

BIS-B

WAP 2.0

WAP

 

Timeout 10000

 

And for each request in code put a higher timeout value ie. 30 ms

 

The other alternative is try to fight it with code, but it is possible with the identity API?, I´m looking at the Transport section.

 

I'll run some tests and post the results. To be continued...

 

Thanks,

 

Contributor
Posts: 19
Registered: ‎06-14-2011
My Device: 9300
My Carrier: Comcel

Re: Domain access permissions for local network IPs

Ok it worked on my tests! changing the transport order and setting timeouts does the trick. no changes in code needed. Smiley Happy