HTTPConnection through proxy

M

Molz

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
 
D

Darryl L. Pierce

Molz said:
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?
 
M

Molz

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.
 
D

Darryl L. Pierce

Molz said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top