×

Discussion Board

Results 1 to 9 of 9

Hybrid View

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    14

    Extract Racoon 0.11.0 functionality for own application

    Hello everyone!
    I'm implementing a client application with http functionality which on the one hand enables web browsing and on the other hand should host web content. For that reason I need basic web server functionality integrated. The idea is to take parts of the Racoon project to receive incoming http requests and generate response whereas the client application has full awareness of the communication and data sent/received. The question is, which components (httpd-2.2, httpds, ???) of the Racoon 0.11.0 project are required for that basic functionality and which is the most efficient way of integrating that parts to my application. Can I use parts of Racoon as stand-alone application and access it from my application or is it more reasonable to copy parts of the source code?
    Can anyone give me a hint on that issue?
    Thanks and regards,
    Bernie

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Extract Racoon 0.11.0 functionality for own application

    Quote Originally Posted by bfamler View Post
    Can I use parts of Racoon as stand-alone application and access it from my application or is it more reasonable to copy parts of the source code?
    Can anyone give me a hint on that issue?
    Thanks and regards,
    Bernie
    Will your application run in a context where there might also be a general purpose web-server running, or is the a situation such that you don't need to take that possibility into account?

    Do you need to handle all http requests that come to the device or is it just a particular part of the URL namespace that should be handled by your application?

    Anyway, one approach would be to implement an Apache module that you load into Raccoon and then have that module communicate with your application using some IPC mechanism. That way you would not have to modify Raccoon itself at all, but could use it as a black box.

    If you want to bundle everything into your application, then have a look at the function RunL in .../httpds/src/httpds_chttpdserver.cpp. But also in that case you would still need to implement an Apache module for handing the requests.

    Johan

  3. #3
    Registered User
    Join Date
    Mar 2006
    Posts
    14

    Re: Extract Racoon 0.11.0 functionality for own application

    Hi Johan,
    thanks for your reply.
    Basically it is not necessary to have another general purpose web server running. It would be great if I my app would be aware of all incoming http requests that come to the device.
    More or less the basic functionality I expect from Racoon is:
    - listening to a specific port (pref. 80)
    - hosting simple web content and distribute it automatically
    - give "callbacks" when a http GET/POST request comes to the device to process the body data (e.g. content of forms, posted data).
    I don't even need the connector functionality for domain name resolution in the beginning, because my app can distribute the ip address and port of the webserver via SIP.
    The mentioned approach with an Apache module sounds ok for me. The module will inform my application of incoming requests and could also deliver the content of the request? Does the general web server behaviour remain (distribute web content to requesting clients) even if a module handles the incoming request?
    The implementation in httpds_chttpdserver.cpp will let my app control Racoon (start, stop) right?
    In this case, do I need to copy the whole Racoon source code or would certain components of Racoon (httpd-2.2,..) sufficient?
    Do you know some good examples of Apache modules with IPC functionality or any tutorials how to build them?

    Best regards,
    Bernie

  4. #4
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Extract Racoon 0.11.0 functionality for own application

    Quote Originally Posted by bfamler View Post
    ...
    The mentioned approach with an Apache module sounds ok for me. The module will inform my application of incoming requests and could also deliver the content of the request?
    Yes, you arrange for it to do that.
    Does the general web server behaviour remain (distribute web content to requesting clients) even if a module handles the incoming request?
    Yes, your module can look at the request and choose not to handle it if it is some regular http request.
    The implementation in httpds_chttpdserver.cpp will let my app control Racoon (start, stop) right?
    If you want just your app to start/stop Raccoon and not embed it, then httpds_chttpdserver.cpp is not the right place to look.
    In this case, do I need to copy the whole Racoon source code or would certain components of Racoon (httpd-2.2,..) sufficient?
    For starting and stopping Raccoon you only need to use the components in httpd/public/mws. Start by looking at CHttpd.h. You need to link to httpdc.lib and httpd.lib.

    But I have actually recently re-structured Raccoon, so that it now is easier to take just the web-server into use. It's all in the SourceForge Subversion repository already, but so far only in the trunk.
    Do you know some good examples of Apache modules with IPC functionality or any tutorials how to build them?
    If you compile your module as C++, then you can use all IPC mechanisms of Symbian.

    Check out http://httpd.apache.org/docs/2.2/developer/ for information about modules and look into httpd-2.2/modules/arch/symbian for Symbian example modules.

    Johan

  5. #5
    Registered User
    Join Date
    Mar 2006
    Posts
    14

    Re: Extract Racoon 0.11.0 functionality for own application

    Thanks for that Johan.
    I checked out the trunk of the sourceforge racoon repos.
    Some questions before I can start:
    Which are the necessary files to run httpd on the emulator (without connector, just offline-mode) and what is the correct directory (sdk root, epoc32)? Is S60 3rd Ed. FP1 supported?
    Can I build and deploy the needed components with Carbide.c++? Any restrictions?
    Do I need PyS60 installed for the basic webserver functionality?
    If so, which version of PyS60 is needed (1.4.2)?

    Best regards,
    Bernie

  6. #6
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Extract Racoon 0.11.0 functionality for own application

    Quote Originally Posted by bfamler View Post
    I checked out the trunk of the sourceforge racoon repos.
    That was quick

    Some questions before I can start:
    Which are the necessary files to run httpd on the emulator (without connector, just offline-mode) and what is the correct directory (sdk root, epoc32)?
    It probably doesn't matter where you checked out the trunk, but if you want to be on the safe side, then the following arrangement gives you an identical setup as the one I use and thus should work without a hitch.

    In the S60 SDK directory where the epoc32 directory resides:
    Code:
    mkdir mws
    cd mws
    svn co https://raccoon.svn.sourceforge.net/svnroot/raccoon/phone/trunk/phone
    Then, provided you have the PyS60 and Open C SDKs installed, the following command should build the whole shebang.
    Code:
    cd phone\group
    bldmake bldfiles
    abld build winscw udeb
    That should build all binaries, including the ones you are not interested in, but I suggest you do it anyway to make sure everything works.

    Now, before you can run httpd in the emulator, you need to setup the config directory. Proper support for that is not there yet, so you need to do it manually. Look into phone/install/raccoon.files and copy all files that are installed under C:\ to epoc32\winscw\c.

    Having done that, you should be able to start httpd in the emulator and browse to it using the browser on your laptop. Note that the emulator uses the network stack of your laptop, so if you already are running a web-server or some other software (e.g. Skype) that is using port 80, you need to change the port in epoc32\winscw\c\data\apache\conf\httpd.conf.

    Is S60 3rd Ed. FP1 supported?
    I used to use the FP1 SDK, but there were some issues with PyS60, which does not officially support FP1, so I switched back to MR.
    Can I build and deploy the needed components with Carbide.c++? Any restrictions?
    No idea - I'm a command line junkie so I build directly from the prompt.
    Do I need PyS60 installed for the basic webserver functionality?
    If so, which version of PyS60 is needed (1.4.2)?
    No, you don't need PyS60 for just the webserver (but any 1.4.x version should be fine). You only need it if you build using the build all instructions above. You can skip Python by building
    Code:
    mwsutil
    httpd-2.2.4
    ui\s60\emulutil 
    ui\s60\httpdviews
    ui\s60\httpdui
    individually in that order. Just enter the group directory of each component and issue
    Code:
    bldmake bldfiles
    abld build winscw udeb
    In this case it should also be sufficient to just copy httpd-2.2.4\symbian\sis\data to epoc32\winscw\c.

    Johan

Similar Threads

  1. How can the WAP browser communicate to J2ME application?
    By hbfornies in forum Mobile Java General
    Replies: 20
    Last Post: 2007-03-02, 16:32
  2. Download Application and Technology
    By arizkohli in forum Symbian
    Replies: 0
    Last Post: 2003-06-27, 15:14
  3. filtering application as a recipient?
    By aidj in forum General Messaging
    Replies: 1
    Last Post: 2002-11-12, 06:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×