__NOTOC__
== 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: <code>java -jar /xowa/xowa_linux.jar --app_mode http_server --http_server_port 8080</code><ref name='port_80'/>
* Launch your browser and navigate to <code>localhost:8080</code>

=== 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 <code>java -jar /xowa/xowa_linux.jar --app_mode http_server</code>
* Launch your browser on a '''client''' machine and navigate to the IP Address of the server machine. <code>192.168.0.100:8080</code>

=== Limited functions ===
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 <code>http_server.special_pages_safelist</code> and list the Specials you want to keep.

For example:

<pre>
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"
</pre>

This will disable '''ALL''' specials except for the following:
* [[Special:Random|Random]]
* [[Special:XowaSearch|XowaSearch]]
* [[Special:AllPages?from=A|AllPages]]

=== 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 <code>Custom<code> -> <code>CSS<code> box
<pre>
#editform{display:none}
</pre>
* 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 [[Main_Page?action=edit|edit page]]. It will be blank

You can try to hide other elements based on the HTML fragment within <code>page_edit</code> in the <code>/xowa/bin/any/xowa/cfg/app/xowa.gfs</code> file

== Notes ==
<references>
<ref name= 'port_80'>
Note that you will need to run XOWA as root if you choose to pass port 80 for http_server_port.
</ref>
</references>