HTTPConnection through proxy

Discussion in 'Java' started by Molz, Sep 17, 2003.

  1. Molz

    Molz Guest

    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
     
    Molz, Sep 17, 2003
    #1
    1. Advertising

  2. Molz <> 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 <>
    Visit the Infobahn Offramp - <http://bellsouthpwp.net/m/c/mcpierce>
    "What do you care what other people think, Mr. Feynman?"
     
    Darryl L. Pierce, Sep 18, 2003
    #2
    1. Advertising

  3. Molz

    Molz Guest

    >
    > 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.
     
    Molz, Sep 18, 2003
    #3
  4. Molz <> 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 <>
    Visit the Infobahn Offramp - <http://bellsouthpwp.net/m/c/mcpierce>
    "What do you care what other people think, Mr. Feynman?"
     
    Darryl L. Pierce, Sep 19, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marko
    Replies:
    11
    Views:
    18,454
    Marko
    Oct 19, 2004
  2. Itamar Lev

    exception in HttpConnection.run

    Itamar Lev, Oct 24, 2004, in forum: Java
    Replies:
    0
    Views:
    1,719
    Itamar Lev
    Oct 24, 2004
  3. Ravi Ambros Wallau
    Replies:
    0
    Views:
    1,226
    Ravi Ambros Wallau
    Oct 25, 2004
  4. Michael Kremser

    HttpConnection on 7650 and so on

    Michael Kremser, Oct 26, 2004, in forum: Java
    Replies:
    0
    Views:
    388
    Michael Kremser
    Oct 26, 2004
  5. JuHui
    Replies:
    4
    Views:
    5,997
    robert
    Mar 17, 2006
Loading...

Share This Page