![]() |
Accessing server on localhost from opera browser
Hi!
I wrote a simple HTTP server for my Nokia 770 using python for maemo. While the server itself works perfectly I have troubles accessing it from the opera browser without establishing an internet connection. Even when in offline mode opera insists on connecting when I try to access a local server. The loopback device is up and there is no problem connecting to my server using the GPE-mini-browser. Any ideas how to change this behaviour? Thank you, Andi |
Quote:
I'm glad to hear you're working on this, and I hope your problem can be resolved. Having a mini httpserver on board could be a powerful tool. Would you be so kind as to describe exactly (as in, instructions for Linux newbies) how you installed Python on your 770? John |
Andi: The only thing to override that behaviour that i can think of is a patch of sorts. While the lloopback IP exists, can you setup an ad-hoc connection that doles out an IP on the
local range to the 770? Or would it be possible to create a connection that would use the loopback? (Not sure about that last one as 127.0.0.1 would lready be assigned to the device). Other than that, maybe Opera can be set to offline mode. |
Quote:
Installing Python for Maemo is quite easy, there is a description on the Python for Maemo Page , but I'll summarize the steps for you: 1. Install the terminal emulation from http://770.fs-security.com/xterm/ on your 770 using the application installer. 2. Download the python packages from http://sourceforge.net/project/showf...roup_id=144664 , I'd recommend getting at least python2.4_2.4.1-2indt7_arm.deb and python2.4-modules_2.4.1-2indt7_all.deb if you want to do some serious programming. 3. Fire up your xterm and get root by typing "sudo /usr/sbin/gainroot" 4. Install the python packages by typing "dpkg -x python2.4-XXX_arm.deb /" 5. The python2.4-modules package doesn't contain the complete python standard library. To get full pythonic convenience when writing my little webserver, I copied the files cgi.py, BaseHTTPServer.py and SimpleHTTPServer.py from my desktop python installation (living in /usr/lib/python2.4/) to the same directory on my 770. 6. Have fun writing python code. A simple example for a python web server is: Code:
from BaseHTTPServer import HTTPServer Happy Hacking, Andi |
Quote:
I'm not sure whether I got your point. I'd consider it best if there was a possibility to tell opera not to try to establish an internet connection when the server is local. Since there is no such behaviour with the GPE browser, I conclude that the connection process is triggered by opera, not by the operating system. You're right, an "offline mode" for opera would be nice. Your idea of creating some kind of "fake connection" is very interesting. I'll look around a bit in order to find out whether there is a practical way to create such a beast. Thanks, Andi |
Andi: What I'd meant was if it wants a connection, give it one; much in the same way you can take a standalone PC and give it a static IP, you could (/should be able to) do the same with the 770. If Opera tries hitting your local webserver and sees the 770 has an IP of 192.168.0.1, that might make it happy.
Obviously that'd only be a bandaid solution, having zero internet connectivity while using a local web server would be a pain in some instances. I haven't tried it, but creating an ad-hoc connection with a static IP in connection manager oughtta do it. |
|
Quote:
Andi |
Quote:
Thank you and happy hacking, Andi |
Exactly it ;) How's the server doing?
|
All times are GMT. The time now is 09:39. |
vBulletin® Version 3.8.8