| Reply | « Previous Thread | Next Thread » |
|
I've found some threads about this, but all without answers or dodging the subject..
In J2ME when we use httpconnection interface it uses the proxy from the wap access point settings in case there's one. In Python I've noticed (and read) that it doesn't. It's easy to make it use the proxy though. I just haven't found how to "discover" those settings to avoid users having to go to configuration and copy it manually. So, basiclly, anyone knows how to read the selected access point proxy settings? Must be possible... Thanks |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Gaba probably already solved your problems. If it helps anyone, though, I wrote a small class so the user just has to select an access point one time. I'm not taking credit as I collected bits from different sources. And I'm not sure it's perfect (probably not), but it has worked for me so far.
Code:
class AccessPointManager: """ Manages the user's access point selection """ def __init__(self): self.restore() def clear(self): """ Resets the access point """ f = open(ACCESS_POINT_FILENAME, 'w') f.write(repr(None)) f.close() def choose(self): """ Writes the access point to local storage """ apid = socket.select_access_point() f = open(ACCESS_POINT_FILENAME, 'w') f.write(repr(apid)) f.close() apo = socket.access_point(apid) socket.set_default_access_point(apo) def restore(self): """ Tries to restore from local storage, or asks the user if that doesn't work """ try: f = open(ACCESS_POINT_FILENAME, 'rb') apid = eval(f.read()) f.close() if not apid == None: apo = socket.access_point(apid) socket.set_default_access_point(apo) else: self.choose() except: self.choose() |
|
Thanks for your fast replies and for the welcome
![]() But no, that's the common misunderstanding I found in posts related to this question. I do know how to select my default access point and ask/store it in file (that's the tutorial I read, btw ), but that wasn't the question.My application is based on HTTP connection and my operator WAP data connection uses a proxy. That proxy is set up in Access Point configuration, and I would like to know how can I get that info (proxy URL/port) without asking user to copy it himself.. Thanks |
|
I could be wrong, but it seems like that's not implemented, so you'd have to write your own module in Symbian C++. There must be some way if it's in J2ME.
|
|
Yea, that's what I thought. If JavaME does it, Symbian has to be able to do it too.
In JavaME it's done transparently. When we use the HTTPConnection interface, the VM checks for proxy in the AP configuration and sets the HTTP request accordingly. We can't even "not use" the proxy if we wanted to ![]() Now that I started with PyS60 I liked when I tried with putools to make a request and check that it didn't forced me through the setup proxy, but then I cried after googling and finding nothing on reading that info from AP settings.. I have no idea where to look.. |
|
I've found some threads which I believe to be about this topic in Symbian C++.
One of them is http://discussion.forum.nokia.com/fo...ss+point+proxy They mention this C++ class CHttpFilterProxyInterface to set the connection based on the AP proxy settings. I don't really understand Symbian C++ but I'll try to look into this since I have some more search terms to google now ![]() Just wanted to leave this noted here in case anyone else looking for the same thing stumbles upon this thread. Update: So I found nothing about setting Http connections through filtering proxies in WAP AP settings, but I found another thread where they talk about really reading the configuration instead of setting some lower interface to use it. http://discussion.forum.nokia.com/fo...ss+point+proxy CommDB seems to be the "Communication Database" - go figure! :P - and I did find some weird sites talking about using it in PyS60, so I'll go check them out later when I get home
Last edited by skewlboy : 2008-08-21 at 20:46.
|
|
so is there's anyway to make PyS60 use the proxy settings for corresponding AP ?
![]() |
|
Quote:
Best Regards, Croozeus |
|
actually the proxy settings are not used, that's why I asked this question.
I tried with urllib and httplib, same error "getaddrinfo failed". Of course if I specify the proxy in my python script everything is OK, but I don't want to specify any proxy settings, but the pys60 to automatically used them from the AP settings. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| getting access point configuration | roidayan | Python | 3 | 2009-03-15 00:56 |
| Connecting J2ME application to Internet using WAP access point? | khurshed79 | Mobile Java Networking & Messaging & Security | 8 | 2008-08-18 13:40 |
| Unable to connect to Wi-Fi access point after scanning the access point | Ahtesham.Khan | General Symbian C++ | 1 | 2007-08-10 09:20 |
| NOKIA D211 doesn't work with my 3com and Asus access point | nuvolablu | Multimodecards | 4 | 2004-04-24 20:00 |
| Midlet using a default Access Point | fboya | Mobile Java Networking & Messaging & Security | 0 | 2003-07-03 19:53 |