-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
184 lines (173 loc) · 14.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta content="True" name="HandheldFriendly">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="viewport" content="width=device-width">
<meta name="description" content="nginx-clojure.github.io : Nginx module for embedding Clojure / Java / Groovy programs, typically those Ring based handlers">
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<!-- bootstrap cdn -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">
<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.0.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="javascripts/fix.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/my.css">
<title>Home@Nginx-Clojure</title>
</head>
<body>
<div id="header">
<!-- HEADER -->
<nav id="header_wrap" class="" role="navigation">
<header id="header_logo_title" class="inner container">
<ul class="external-link-buttons">
<li>
<a id="forkme_banner" href="https://github.com/nginx-clojure/nginx-clojure" target="_blank">View on GitHub</a>
</li>
<!-- <li>
<a id="google_group_banner" href="https://groups.google.com/forum/#!forum/nginx-clojure" target="_blank">Google Group</a>
</li> -->
</ul>
<div id="project_logo">
<h1 id="project_title">nginx-clojure</h1>
<ul class="social-buttons">
<li>
<iframe class="github-btn" src="github-btn.html?user=nginx-clojure&repo=nginx-clojure&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="102px" height="20px"></iframe>
</li>
<li>
<iframe class="github-btn" src="github-btn.html?user=nginx-clojure&repo=nginx-clojure&type=fork&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
</li>
</ul></div>
<h6 id="project_tagline">Nginx module for embedding Clojure / Java / Groovy programs, typically those Ring based handlers</h6>
</header>
<div class="btn-group" style="border-top-width: 1px;border-top-color: #fff;">
<a href="index.html" class="btn btn-sample btn-md"><span class="glyphicon glyphicon-home"></span> Home</a>
<a href="quickstart.html" class="btn btn-sample btn-md"><span class="glyphicon glyphicon-flash"></span> Quick Start</a>
<a href="downloads.html" class="btn btn-sample btn-md"><span class="glyphicon glyphicon-download-alt"></span> Downloads</a>
<a href="installation.html" class="btn btn-sample btn-md"><span class="glyphicon glyphicon-hdd"></span> Installation</a>
<div class="btn-group">
<button type="button" class="btn btn-sample btn-md dropdown-toggle" data-toggle="dropdown" id="docDropDownBtn"><span class="glyphicon glyphicon-cog"></span> Configuration <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<li><a href="configuration.html#user-content-21-jvm-path--class-path--other-jvm-options"><span class="glyphicon glyphicon-cog"></span> JVM Path,Class Path & Other JVM Options</a></li>
<li><a href="configuration.html#user-content-22-initialization-handler-for-nginx-worker"><span class="glyphicon glyphicon-cog"></span> Initialization Handler for nginx worker</a></li>
<li><a href="configuration.html#user-content-23-content-ring-handler-for-location"><span class="glyphicon glyphicon-cog"></span> Content Ring Handler for Location</a></li>
<li><a href="configuration.html#user-content-24-chose--coroutine-based-socket-or-asynchronous-socketchannel-or-thread-pool-for-slow-io-operations"><span class="glyphicon glyphicon-cog"></span> Coroutine/Asynchronous Client Channel/Thread Pool </a></li>
<li><a href="configuration.html#user-content-25-nginx-rewrite-handler"><span class="glyphicon glyphicon-cog"></span> Nginx Rewrite Handler</a></li>
<li><a href="configuration.html#user-content-26-nginx-access-handler"><span class="glyphicon glyphicon-cog"></span> Nginx Access Handler</a></li>
<li><a href="configuration.html#user-content-27-nginx-header-filter"><span class="glyphicon glyphicon-cog"></span> Nginx Header Filter</a></li>
<li><a href="configuration.html#user-content-28-nginx-body-filter"><span class="glyphicon glyphicon-cog"></span> Nginx Body Filter</a></li>
<li><a href="configuration.html#user-content-29-nginx-log-handler"><span class="glyphicon glyphicon-cog"></span> Nginx Log Handler</a></li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-sample btn-md dropdown-toggle" data-toggle="dropdown" id="docDropDownBtn"><span class="glyphicon glyphicon-book"></span> Documents <span class="caret"></span></button>
<ul class="dropdown-menu" role="menu">
<!-- <li><a href="quickstart.html"><span class="glyphicon glyphicon-flash"></span> Quick Start</a></li> -->
<li><a href="directives.html"><span class="glyphicon glyphicon-th-list text-warning"></span> Directives Reference</a></li>
<li><a href="embed.html"><span class="glyphicon glyphicon-gift"></span> Embedding Nginx-Clojure into A standard App</a></li>
<li><a href="more.html#user-content-34-server-channel-for-long-polling--server-sent-events-sse"><span class="glyphicon glyphicon-envelope"></span> Server Channel for Long Polling & Server Sent Events</a></li>
<li><a href="subpub.html"><span class="glyphicon glyphicon-envelope text-warning"></span> Pub/Sub Among Nginx Worker Processes</a></li>
<li><a href="sharedmap.html"><span class="glyphicon glyphicon-envelope text-warning"></span> Shared Map & Session Store</a></li>
<li><a href="more.html#user-content-36-asynchronous-client-channel"><span class="glyphicon glyphicon-road"></span> Asynchronous Client Channel</a></li>
<li><a href="more.html#user-content-37--about-logging"><span class="glyphicon glyphicon-th-list"></span> About Logging</a></li>
<li><a href="more.html#user-content-38--sever-side-websocket"><span class="glyphicon glyphicon-th-list"></span> Sever Side WebSocket</a></li>
<li><a href="more.html#user-content-39--java-standard-restful-web-services-with-jersey"><span class="glyphicon glyphicon-th-list"></span> Java standard RESTful web services with Jersey</a></li>
<li><a href="more.html#user-content-310-embeding-tomcat"><span class="glyphicon glyphicon-th-list"></span> Embeding Tomcat</a></li>
<li><a href="more.html#user-content-311-more-about-nginx-worker-process"><span class="glyphicon glyphicon-th-list"></span> More about Nginx Worker Process</a></li>
<li><a href="more.html"><span class="glyphicon glyphicon-th-list"></span> More about Nginx-Clojure</a></li>
<li><a href="api/"><span class="glyphicon glyphicon-book text-warning"></span> API Reference (Clojure)</a></li>
</ul>
</div>
<a href="userfullLinks.html" class="btn btn-sample btn-md"><span class="glyphicon glyphicon-share-alt"></span> Useful Links</a>
</div>
</nav>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<h1><a id="user-content-core-features" class="anchor" aria-hidden="true" href="#core-features"><span aria-hidden="true" class="octicon octicon-link"></span></a>Core Features</h1>
<p>The latest release is v0.6.0, more detail changes about it can be found from <a href="//nginx-clojure.github.io/downloads.html" rel="nofollow">Release History</a>.</p>
<ol>
<li>Compatible with <a href="https://github.com/ring-clojure/ring/blob/master/SPEC">Ring</a> and obviously supports those Ring based frameworks, such as Compojure etc.</li>
<li>Http Services by using Clojure / Java / Groovy to write simple handlers for http services.</li>
<li>Nginx Access Handler by Clojure / Java / Groovy</li>
<li>Nginx Header Filter by Clojure / Java / Groovy</li>
<li>Nginx Body Filter by Clojure / Java / Groovy</li>
<li>Nginx Log Handler by Clojure / Java / Groovy</li>
<li>HTTP V2 support in both standard edition and embedded edition which are compiled against Nginx 1.18.0+</li>
<li>Support Java 9, 10, 11, 12, 19</li>
<li>Support to use jdk19 built-in coroutine viz. Continuation</li>
<li>Pub/Sub Among Nginx Worker Processes</li>
<li>Shared Map based on shared memory & Shared Map based Ring session store</li>
<li>Support Sente, see <a href="https://github.com/ptaoussanis/sente/pull/160">this PR</a>
</li>
<li>Support Per-message Compression Extensions (PMCEs) for WebSocket</li>
<li>APIs for Embedding Nginx-Clojure into a Standard Clojure/Java/Groovy App</li>
<li>Server Side Websocket</li>
<li>A build-in Jersey container to support java standard RESTful web services (JAX-RS 2.0)</li>
<li>Tomcat 8 embedding support (so servlet 3.1/jsp/sendfile/JSR-356 websocket work within nginx!)</li>
<li>Dynamic proxying by using Clojure / Java / Groovy to write a simple nginx rewrite handler to set var or return errors before proxy pass or content ring handler</li>
<li>Non-blocking coroutine based socket which is Compatible with Java Socket API and works well with largely existing java library such as apache http client, mysql jdbc drivers.
With this feature one java main thread can handle thousands of connections.</li>
<li>Handle multiple sockets parallel in sub coroutines, e.g. we can invoke two remote services at the same time.</li>
<li>Asynchronous callback API of socket/Channel for some advanced usage</li>
<li>Long Polling & Server Sent Events</li>
<li>Run initialization clojure code when nginx worker starting</li>
<li>Support user defined http request method</li>
<li>Compatible with the Nginx lastest most mainline version 1.23.3. (Nginx 1.22.X, 1.20.X, 1.18.x, 1.14.x, 1.12.x, 1.8.x, 1.6.x, 1.4.x is also ok, older version is not tested and maybe works.)</li>
<li>One of benifits of <a href="http://nginx.org/" rel="nofollow">Nginx</a> is worker processes are automatically restarted by a master process if they crash</li>
<li>Utilize lazy headers and direct memory operation between <a href="http://nginx.org/" rel="nofollow">Nginx</a> and JVM to fast handle dynamic contents from Clojure or Java code.</li>
<li>Utilize <a href="http://nginx.org/" rel="nofollow">Nginx</a> zero copy file sending mechanism to fast handle static contents controlled by Clojure or Java code.</li>
<li>Support Linux x64, Linux x86 32bit, Win32, Win64 and Mac OS X. Freebsd version can also be got from Freebsd ports.
By the way it is very fast, the benchmarks can be found <a href="https://github.com/ptaoussanis/clojure-web-server-benchmarks/">HERE(with wrk2)</a>.</li>
</ol>
<h1><a id="user-content-jar-repository" class="anchor" aria-hidden="true" href="#jar-repository"><span aria-hidden="true" class="octicon octicon-link"></span></a>Jar Repository</h1>
<p>Nginx-Clojure has already been published to <a href="https://clojars.org/" rel="nofollow">https://clojars.org/</a> whose maven repository is</p>
<div class="highlight highlight-text-xml"><pre><<span class="pl-ent">repository</span>>
<<span class="pl-ent">id</span>>clojars.org</<span class="pl-ent">id</span>>
<<span class="pl-ent">url</span>>http://clojars.org/repo</<span class="pl-ent">url</span>>
</<span class="pl-ent">repository</span>></pre></div>
<p>After adding clojars repository, you can reference nginx-clojure 0.6.0 , e.g.</p>
<h2><a id="user-content-leiningen-clojure-no-need-to-add-clojars-repository-which-is-a-default-repository-for-leiningen" class="anchor" aria-hidden="true" href="#leiningen-clojure-no-need-to-add-clojars-repository-which-is-a-default-repository-for-leiningen"><span aria-hidden="true" class="octicon octicon-link"></span></a>Leiningen (clojure, no need to add clojars repository which is a default repository for Leiningen)</h2>
<div class="highlight highlight-source-clojure"><pre>[nginx-clojure <span class="pl-s"><span class="pl-pds">"</span>0.6.0<span class="pl-pds">"</span></span>]</pre></div>
<h2><a id="user-content-gradle-groovyjava" class="anchor" aria-hidden="true" href="#gradle-groovyjava"><span aria-hidden="true" class="octicon octicon-link"></span></a>Gradle (groovy/java)</h2>
<pre><code>compile "nginx-clojure:nginx-clojure:0.6.0"
</code></pre>
<h2><a id="user-content-maven" class="anchor" aria-hidden="true" href="#maven"><span aria-hidden="true" class="octicon octicon-link"></span></a>Maven</h2>
<div class="highlight highlight-text-xml"><pre><<span class="pl-ent">dependency</span>>
<<span class="pl-ent">groupId</span>>nginx-clojure</<span class="pl-ent">groupId</span>>
<<span class="pl-ent">artifactId</span>>nginx-clojure</<span class="pl-ent">artifactId</span>>
<<span class="pl-ent">version</span>>0.6.0</<span class="pl-ent">version</span>>
</<span class="pl-ent">dependency</span>></pre></div>
<h1><a id="user-content-more-documents" class="anchor" aria-hidden="true" href="#more-documents"><span aria-hidden="true" class="octicon octicon-link"></span></a>More Documents</h1>
<p>More Documents can be found from its web site <a href="http://nginx-clojure.github.io/" rel="nofollow">nginx-clojure.github.io</a></p>
<h1><a id="user-content-license" class="anchor" aria-hidden="true" href="#license"><span aria-hidden="true" class="octicon octicon-link"></span></a>License</h1>
<p>Copyright © 2013-2023 Zhang, Yuexiang (xfeep) and released under the BSD 3-Clause license.</p>
<p>This program uses:</p>
<ul>
<li>Re-rooted ASM bytecode engineering library which is distributed under the BSD 3-Clause license</li>
<li>Modified Continuations Library Written by Matthias Mann is distributed under the BSD 3-Clause license</li>
</ul>
</section>
</div>
<div id="footer">
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p>
Powered by <a href="http://getbootstrap.com/">Twitter Bootstrap</a>
</p>
</footer>
</div>
</div>
<script type="text/javascript">
//$("a[href^='http']").attr("target","_blank");
//setTimeout("fixNavbarIssue();", 1000);
</script>
</body>
</html>