Page created:
Jun 16, 2009 (? ago)
Last modified ? ago
To main page | Opera Unite HowTo's

URLs


See Uniteness for better way to handle URLs.

Basically URLs that you can use are fixed format:
http://[computer_name].[your_opera_login].operaunite.com/[application]
http://[computer_name].[your_opera_login].operaunite.com/[application]/[page]
[computer_name] is the name you gave your computer when installing Opera Unite.
[your_opera_login] is the login to your Opera account.
[application] is the name of the service defined in config.xml.
[page] is what you define below:

Brackets ([]) added for clarity, URLs don't include those.

Then you define in your service:
window.onload = function () {
    webserver = opera.io.webserver
    if (webserver)    {
        webserver.addEventListener('_index', start_page, false);
        webserver.addEventListener('other', other_page, false);
        // webserver.addEventListener('_request', all_requests, false);
        // webserver.addEventListener('_close', onunload, false);
        // [1]
    }
}
function start_page(r) {    // http://..../[application]/
   // ....
}

function other_page(r) {    // http://..../[application]/other/
   // ....
}
start_page will be called at http://....operaunite.com/application/
other_page will be called at http://....operaunite.com/application/other/

If you enable '_request' - any request will call that (see below for "User-friendly URLs").

Don't forget to enable webserver library in your config.xml.

In Uniteness

URLs([
    '_index', start_page,
    'edit', edit_item,
    'imgs', 'static',
]); 

User-friendly URLs

It seems somewhat user-friendly URLs are POSSIBLE. Digging request hierarchy I've discovered variable:
r.connection.request.uri = "/[service_path]/delete?get_param=get_value"
The "/[service_path]/delete?get_param=get_value" is the analogous to $_SERVER[REQUEST_URI] in PHP, which means you can process it yourself.

You need to hook into '_request' URL instead of '_index'. [See URLs about 'hooking']

Domains (your-name.com)

Originally I thought that using CNAME would be possible, but after a test I have to admit that CNAMEs don't work.

You can still have a domain point to your Unite browser, but you need a registrar that supports framed domains or URL redirects. Many browsers (NameCheap and Dynadot for sure) support this option. Just setup your domain to be a redirect to your Opera Unite URL.

Slava V. [about me]


main page



Last updated


  1. Markuper (HTML templates)
  2. .ua
  3. Opera Unite HowTo's
  4. .us (files)
  5. Distribute Your Application
  6. 24/7 sites (permanent applications - idea) [stub]
  7. Issues
  8. HTTP Connections (AJAX/REST)
  9. Cookies
  10. file_wrap.js - File Wrapper
  11. Basic HowTo: Simple app (tutorial)
  12. Static images, client-side scripts
  13. Application Examples
  14. How to Debug Opera Unite apps
  15. Persistence & databases
  16. Opera Unite benchmark
  17. From PHP to Opera Unite
  18. Uniteness (Framework)
  19. Config.xml
  20. Key-value storage
  21. Widget Object
  22. Notifications (Growl'esque)
  23. Reset (debug)
  24. Cron example
  25. What I meant by CNAMEs
  26. Wish List
  27. Device Unavailable
  28. StopLorem (Opera Unite blogging)
  29. uniteness-0.11
  30. GET/POST data
  31. CRUD And Static (example)
  32. Opera object
  33. URLs
  34. Headers & Redirects
  35. Error Console
  36. JSON State (storing data)
  37. Security
  38. /storage/ (in fileio)
  39. Yusef library
  40. unite_info (a-la php_info)
  41. Javascript Imports
  42. onunload / _close
  43. fileio: Sandboxed Filesystem
  44. Request Hierarchy (like php_info)
  45. Intro: Web Apps with Opera Unite