1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-10-27 20:34:16 +00:00
gnosygnu_xowa/home/wiki/App/Xtn/Browser/HTTP_Server.html

256 lines
11 KiB
HTML

<!DOCTYPE html>
<html dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>App/Xtn/Browser/HTTP Server - XOWA</title>
<link rel="shortcut icon" href="https://gnosygnu.github.io/xowa/xowa_logo.png" />
<link rel="stylesheet" href="https://gnosygnu.github.io/xowa/xowa_common.css" type="text/css">
</head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck="false">
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<div id="content" class="mw-body">
<h1 id="firstHeading" class="firstHeading"><span>App/Xtn/Browser/HTTP Server</span></h1>
<div id="bodyContent" class="mw-body-content">
<div id="siteSub">From XOWA: the free, open-source, offline wiki application</div>
<div id="contentSub"></div>
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
<h2>
<span class="mw-headline" id="Credits">Credits</span>
</h2>
<p>
Considerable thanks goes to Mattze96 for proposing and developing the HTTP server.
</p>
<h2>
<span class="mw-headline" id="Overview">Overview</span>
</h2>
<p>
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 <a href="/wiki/App/Xtn/Browser/XOWA_viewer" id="xolnki_2" title="App/Xtn/Browser/XOWA viewer">App/Xtn/Browser/XOWA_viewer</a>).
</p>
<p>
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.
</p>
<p>
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 <a href="https://sourceforge.net/p/xowa/discussion/general/thread/fa4baf84/" rel="nofollow" class="external free">https://sourceforge.net/p/xowa/discussion/general/thread/fa4baf84/</a>
</p>
<h2>
<span class="mw-headline" id="Usage">Usage</span>
</h2>
<h3>
<span class="mw-headline" id="Other_browsers">Other browsers</span>
</h3>
<p>
To use the XOWA HTTP server in another browser, do the following:
</p>
<ul>
<li>
Launch XOWA with the following command line: <code>java -jar /xowa/xowa_linux.jar --app_mode http_server --http_server_port 8080</code><sup id="cite_ref-port_80_0-0" class="reference"><a href="#cite_note-port_80-0">[1]</a></sup>
</li>
<li>
Launch your browser and navigate to <code>localhost:8080</code>
</li>
</ul>
<h3>
<span class="mw-headline" id="Across_the_network">Across the network</span>
</h3>
<p>
To use the XOWA HTTP server in a server setting, do the following:
</p>
<ul>
<li>
Launch XOWA on the <b>server</b> machine with the command line <code>java -jar /xowa/xowa_linux.jar --app_mode http_server</code>
</li>
<li>
Launch your browser on a <b>client</b> machine and navigate to the IP Address of the server machine. <code>192.168.0.100:8080</code>
</li>
</ul>
<h3>
<span class="mw-headline" id="Running_HTTP_Server">Running HTTP_Server</span>
</h3>
<p>
Note that you will only be able to read pages with HTTP Server. Some functions will not work, like:
</p>
<ul>
<li>
Importing a wiki
</li>
<li>
Visiting Special pages
</li>
</ul>
<p>
<br>
</p>
<h2>
<span class="mw-headline" id="Advanced">Advanced</span>
</h2>
<h3>
<span class="mw-headline" id="Disabling_Specials_such_as_XowaCfg">Disabling Specials such as XowaCfg</span>
</h3>
<p>
Launch xowa_server with a command-line flag of <code>http_server.special_pages_safelist</code> and list the Specials you want to keep.
</p>
<p>
For example:
</p>
<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>
<p>
This will disable <b>ALL</b> specials except for the following:
</p>
<ul>
<li>
<a href="/wiki/Special:Random" id="xolnki_3" title="Special:Random">Random</a>
</li>
<li>
<a href="/wiki/Special:XowaSearch" id="xolnki_4" title="Special:XowaSearch">XowaSearch</a>
</li>
<li>
<a href="/wiki/Special:AllPages%3Ffrom%3DA" id="xolnki_5" title="Special:AllPages?from=A">AllPages</a>
</li>
</ul>
<h3>
<span class="mw-headline" id="Disabling_Edit_Page">Disabling Edit Page</span>
</h3>
<p>
Modify the <a href="/wiki/Special:XowaCfg%3Fgrp%3Dxowa.html.css" id="xolnki_6" title="Special:XowaCfg?grp=xowa.html.css">Special:XowaCfg?grp=xowa.html.css</a> page by hiding the edit div.
</p>
<p>
Specifically:
</p>
<ul>
<li>
Go to <a href="/wiki/Special:XowaCfg%3Fgrp%3Dxowa.html.css" id="xolnki_7" title="Special:XowaCfg?grp=xowa.html.css">Special:XowaCfg?grp=xowa.html.css</a>
</li>
<li>
Enter in the following within the <code>Custom</code> -&gt; <code>CSS</code> box
</li>
</ul>
<pre>
#editform{display:none}
</pre>
<ul>
<li>
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)
</li>
<li>
Start http_server and try to go to an <a href="/wiki/Main_Page%3Faction%3Dedit" id="xolnki_8" title="Main Page?action=edit">edit page</a>. It will be blank
</li>
</ul>
<p>
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
</p>
<h2>
<span class="mw-headline" id="Notes">Notes</span>
</h2>
<ol class="references">
<li id="cite_note-port_80-0">
<span class="mw-cite-backlink"><a href="#cite_ref-port_80_0-0">^</a></span> <span class="reference-text">Note that you will need to run XOWA as root if you choose to pass port 80 for http_server_port.</span>
</li>
</ol>
</div>
</div>
</div>
<div id="mw-head" class="noprint">
<div id="left-navigation">
<div id="p-namespaces" class="vectorTabs">
<h3>Namespaces</h3>
<ul>
<li id="ca-nstab-main" class="selected"><span><a id="ca-nstab-main-href" href="index.html">Page</a></span></li>
</ul>
</div>
</div>
</div>
<div id='mw-panel' class='noprint'>
<div id='p-logo'>
<a style="background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href="http://xowa.org/" title="Visit the main page"></a>
</div>
<div class="portal" id='xowa-portal-home'>
<h3>XOWA</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/index.html" title='Visit the main page'>Main page</a></li>
<li><a href="http://xowa.org/screenshots.html" title='See screenshots of XOWA'>Screenshots</a></li>
<li><a href="https://www.youtube.com/watch?v=q0qbXYXEH6M" title="See a video of XOWA Desktop in action">Video</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
<li><a href="http://xowa.org/home/wiki/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-started'>
<h3>Getting started</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
<li><a href="http://xowa.org/home/wiki/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
<li><a href="http://xowa.org/home/wiki/App/Import/Other_wikis.html" title='Learn how to set up other Wikipedias'>Other Wikipedias</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-android'>
<h3>Android</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Android/Setup.html" title='Setup XOWA on your Android device'>Setup</a></li>
<li><a href="https://www.youtube.com/watch?v=jsMTBxGweUw" title="See a video of XOWA Android in action">Video</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-help'>
<h3>Help</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Help/About.html" title='Get more information about XOWA'>About</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Feedback.html" title='Questions? Comments? Leave feedback for XOWA'>Feedback</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-blog'>
<h3>Blog</h3>
<div class="body">
<ul>
<li><a href="http://xowa.org/home/wiki/Blog.html" title='Follow XOWA''s development process'>Current</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-links'>
<h3>Links</h3>
<div class="body">
<ul>
<li><a href="http://dumps.wikimedia.org/backup-index.html" title="Get wiki datababase dumps directly from Wikimedia">Wikimedia dumps</a></li>
<li><a href="https://archive.org/search.php?query=xowa" title="Search archive.org for XOWA files">XOWA @ archive.org</a></li>
<li><a href="http://en.wikipedia.org" title="Visit Wikipedia (and compare to XOWA!)">English Wikipedia</a></li>
</ul>
</div>
</div>
<div class="portal" id='xowa-portal-donate'>
<h3>Donate</h3>
<div class="body">
<ul>
<li><a href="https://archive.org/donate/index.php" title="Support archive.org!">archive.org</a></li><!-- listed first due to recent fire damages: http://blog.archive.org/2013/11/06/scanning-center-fire-please-help-rebuild/ -->
<li><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title="Support Wikipedia!">Wikipedia</a></li>
<li><a href="http://xowa.org/home/wiki/Help/Donate.html" title="Support XOWA!">XOWA</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>