-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from sunng87/feature/http-3
feat: implement http3 connector
- Loading branch information
Showing
9 changed files
with
113 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.slf4j.simpleLogger.defaultLogLevel=debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(ns rj9a.http3 | ||
(:gen-class) | ||
(:require [ring.adapter.jetty9 :as jetty])) | ||
|
||
(defn dummy-app [req] {:body "It works" :status 200}) | ||
|
||
(defn -main [& args] | ||
(jetty/run-jetty dummy-app {:port 5000 :http false :http3? true :ssl-port 5443 | ||
:keystore "dev-resources/keystore.jks" | ||
:key-password "111111" | ||
:keystore-type "jks" | ||
:sni-host-check? false})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/target | ||
/lib | ||
/classes | ||
/checkouts | ||
pom.xml | ||
pom.xml.asc | ||
*.jar | ||
*.class | ||
.lein-deps-sum | ||
.lein-failures | ||
.lein-plugins | ||
.lein-repl-history | ||
.lein-env | ||
|
||
.idea/ | ||
*.iml | ||
/.nrepl-port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(def jetty-version "10.0.9") | ||
|
||
(defproject info.sunng/ring-jetty9-adapter-http3 "0.1.0-SNAPSHOT" | ||
:description "Ring adapter for jetty 9 and above, meta package for http3" | ||
:url "http://github.com/sunng87/ring-jetty9-adapter" | ||
:license {:name "Eclipse Public License" | ||
:url "http://www.eclipse.org/legal/epl-v10.html"} | ||
:deploy-repositories {"releases" :clojars} | ||
:global-vars {*warn-on-reflection* true} | ||
:dependencies [[org.eclipse.jetty.http3/http3-server ~jetty-version]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(ns ring.adapter.jetty9.http3 | ||
(:import [org.eclipse.jetty.server | ||
HttpConfiguration SecureRequestCustomizer] | ||
[org.eclipse.jetty.http3.server | ||
HTTP3ServerConnectionFactory HTTP3ServerConnector] | ||
[org.eclipse.jetty.http3.api Session$Server$Listener])) | ||
|
||
(defn http3-connector [server http-configuration ssl-context-factory port host] | ||
(let [connection-factory (HTTP3ServerConnectionFactory. http-configuration) | ||
connector (HTTP3ServerConnector. server ssl-context-factory | ||
(into-array HTTP3ServerConnectionFactory [connection-factory]))] | ||
(doto connector | ||
(.setPort port) | ||
(.setHost host)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters