06-04-2009 10:42 AM
Hi, i have an application that connects to a web server over wi-fi. It´s possible to set up a proxy server for a wi-fi connections?
Regards
Roberto Solis
06-04-2009 06:56 PM
06-04-2009 07:18 PM
Well, on the PC you can specify the proxy server your network wants you to use in your Browser or using a PAC file. There is no corresponding setting apparent on the Blackberry browsers, includig the HotSpot browsers.
When your Blackberry using a BES, you dont need to worry about it on the device as the MDS admin would have set up a proxy server there.
If you are not using a BES, and are on WiFi such that you have a local IP from your internal network, and are trying to go to some internal web sites that you can only reach through a proxy then I can see how the user would face an issue.
06-04-2009 08:08 PM
Exactly this is my doubt, if in my network has configured a proxy server to control the internet access, on the browser of the pc i need to configure the proxy parameters for internet access, if my blackberry application connects to the network for a wi-fi connection i need to set up a proxy parameters for the httpconnection?, it is possible?
Thanks
06-25-2009 06:36 PM
I also need to know this. Does anyone know if this is possible?
I see that none of the browsers in BB have a proxy field to set up.
I also do not see anything related to proxy in HTTPConnection class to open an http connection through a proxy. Is there a built-in support for this?
There is a ServiceRecord named "Wi-Fi TCP/IP Transport". There there is a Gateway/IP address. Is this address related to a proxy?
06-25-2009 07:39 PM
Hi, i finally decided create a socket connection to the proxy server and send a string with the header of the http request.
This works fine for me, i hope that this is to you useful.
06-25-2009 07:55 PM
What do you mean by "the proxy server and send a string with the header of the http request."?
Could you explain?
07-27-2009 04:57 PM
07-27-2009 08:47 PM
Hi, for example, if i want to get www.google.com throught the proxy server proxy.com and the port 8080:
- I create a socket connection to proxy.com like this:
SocketConnection proxy_connection = (SocketConnection)Connector.open( "socket://proxy.com:8080" );
- Create a StringBuffer with the header of a petition to google.com like this:
StringBuffer buf = new StringBuffer();
buf.append( "GET http://www.google.com HTTP/1.1\n" );
buf.append( "Host: http://www.google.com:80\n' );
buf.append( "Proxy-Authorization: Basic " + Base64Encode( proxyUsername + ":" + proxyPassword ) + "\n" ); // if is necessary
buf.append( "Content-Language: en-US\n" );
buf.append( "Connection: close\n" );
buf.append( "User-Agent: Profile/MIDP-2.0 Configuration/CLDC-1.0\n" );
buf.append( '\n' );
- Sent the header of request to the socket connection:
output_stream = proxy_connection.openOutputStream();
input_stream = proxy_connection.openInputStream();
output_stream.write( buf.toString().getBytes() );
output_stream.flush();
- Finally, i read the response
message = new StringBuffer();
while ( ( readed_char = input_stream.read() ) != -1 ) {
message.append( (char)readed_char );
}
Note: message contains the header and the body of response, do you need to split them
Roberto
09-19-2009 09:20 PM