App/Xtn/Browser/HTTP Server
Credits
Considerable thanks goes to Mattze96 for proposing and developing the HTTP server.
Overview
As of v0.12.1, XOWA now includes an HTTP server in addition to a TCP server. The TCP server is used by the Firefox Add-On (See App/Xtn/Browser/XOWA_viewer).
If you are using Firefox, the Firefox Add-On is the recommended solution for using XOWA within a browser. However, if you want to use XOWA from another browser (for example, Google Chrome) or across the network, you will want to use the HTTP server instead.
Note that the HTTP server is currently in an alpha stage, but should improve with coming releases. If you have any comments or feedback, please see https://sourceforge.net/p/xowa/discussion/general/thread/fa4baf84/
Usage
Other browsers
To use the XOWA HTTP server in another browser, do the following:
-
Launch XOWA with the following command line:
java -jar /xowa/xowa_linux.jar --app_mode http_server --http_server_port 8080
[1] -
Launch your browser and navigate to
localhost:8080
Across the network
To use the XOWA HTTP server in a server setting, do the following:
-
Launch XOWA on the server machine with the command line
java -jar /xowa/xowa_linux.jar --app_mode http_server
-
Launch your browser on a client machine and navigate to the IP Address of the server machine.
192.168.0.100:8080
Limited functionality
Note that you will only be able to read pages with HTTP Server. Some functions will not work, like:
- Importing a wiki
- Visiting Special pages
Advanced
Disabling Specials such as XowaCfg
Launch xowa_server with a command-line flag of http_server.special_pages_safelist
and list the Specials you want to keep.
For example:
java -jar xowa_linux_64.jar --root_dir /xowa/ --show_license n --show_args n --app_mode http_server --http_server.special_pages_safelist "Random|XowaSearch|AllPages"
This will disable ALL specials except for the following:
Disabling Edit Page
Modify the Special:XowaCfg?grp=xowa.html.css page by hiding the edit div.
Specifically:
- Go to Special:XowaCfg?grp=xowa.html.css
-
Enter in the following within the
Custom
->CSS
box
#editform{display:none}
- Save the change by closing the tab or by clicking on a different option (you'll see a check mark icon followed by an undo option)
- Start http_server and try to go to an edit page. It will be blank
You can try to hide other elements based on the HTML fragment within page_edit
in the /xowa/bin/any/xowa/cfg/app/xowa.gfs
file
Notes
- ^ Note that you will need to run XOWA as root if you choose to pass port 80 for http_server_port.