Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   HTTPConnection through proxy (http://www.velocityreviews.com/forums/t126767-httpconnection-through-proxy.html)

Molz 09-17-2003 09:28 AM

HTTPConnection through proxy
 
Hi,

I'm writing a program on J2ME in which I have to do a connection to a
server using HTTPConnection.
I write this code:

connection=(HttpConnection)Connector.open("some
Url",Connector.READ_WRITE,true);
connection.setRequestProperty("Content-Type","text/html");
connection.setRequestProperty("Content-Length","" +
byteVector.length);
connection.setRequestMethod("POST");

When I try it at my home it works but when I try it at school (in
which there are a proxy server) it doesn't work.

I think the problem is the proxy. How can I set the use of the proxy
in the source code?

Thanks
Bye

Darryl L. Pierce 09-18-2003 02:01 AM

Re: HTTPConnection through proxy
 
Molz <molz@inwind.it> wrote:
> I'm writing a program on J2ME in which I have to do a connection to a
> server using HTTPConnection.
> I write this code:
>
> connection=(HttpConnection)Connector.open("some
> Url",Connector.READ_WRITE,true);
> connection.setRequestProperty("Content-Type","text/html");
> connection.setRequestProperty("Content-Length","" +
> byteVector.length);
> connection.setRequestMethod("POST");
>
> When I try it at my home it works but when I try it at school (in
> which there are a proxy server) it doesn't work.
>
> I think the problem is the proxy. How can I set the use of the proxy
> in the source code?


On what type of device are you trying this, or are you trying it from an
emulator? If an emulator, then you'll need to configure the JVM itself
to handle proxy authentication, assuming it's an authenticating proxy.
First, though, are you sure the network at your school allows you to
connect to the outside world?

--
Darryl L. Pierce <mcpierce@myrealbox.com>
Visit the Infobahn Offramp - <http://bellsouthpwp.net/m/c/mcpierce>
"What do you care what other people think, Mr. Feynman?"

Molz 09-18-2003 11:46 AM

Re: HTTPConnection through proxy
 
>
> On what type of device are you trying this, or are you trying it from an
> emulator? If an emulator, then you'll need to configure the JVM itself
> to handle proxy authentication, assuming it's an authenticating proxy.


I'm using nokia developer's suite (an emulator of nokia phones).
There aren't menu to configure the JVM and the proxy needs no authentication.

> First, though, are you sure the network at your school allows you to
> connect to the outside world?


Yes I am.

Darryl L. Pierce 09-19-2003 12:01 PM

Re: HTTPConnection through proxy
 
Molz <molz@inwind.it> wrote:
>> On what type of device are you trying this, or are you trying it from an
>> emulator? If an emulator, then you'll need to configure the JVM itself
>> to handle proxy authentication, assuming it's an authenticating proxy.

>
> I'm using nokia developer's suite (an emulator of nokia phones).
> There aren't menu to configure the JVM and the proxy needs no authentication.


Emulators->Configure Emulators

In the dialog box that pops up, every emulator (except the 3410 and
Series 60 for Symbian) has a field in the middle of the dialog for
defining a proxy server.

--
Darryl L. Pierce <mcpierce@myrealbox.com>
Visit the Infobahn Offramp - <http://bellsouthpwp.net/m/c/mcpierce>
"What do you care what other people think, Mr. Feynman?"


All times are GMT. The time now is 09:03 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.