summaryrefslogtreecommitdiffstats
path: root/server.js
diff options
context:
space:
mode:
Diffstat (limited to 'server.js')
-rw-r--r--server.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/server.js b/server.js
index aa7afb7..88d3a2d 100644
--- a/server.js
+++ b/server.js
@@ -17,15 +17,17 @@ const createGeminiServer = (opt = {}, onRequest) => {
const {
cert, key, passphrase,
tlsOpt,
+ verifyAlpnId,
} = {
cert: null, key: null, passphrase: null,
tlsOpt: {},
+ verifyAlpnId: alpnId => alpnId === ALPN_ID,
...opt,
}
const onConnection = (socket) => {
// todo: clarify if this is desired behavior
- if (socket.alpnProtocol !== ALPN_ID) {
+ if (verifyAlpnId(socket.alpnProtocol) !== true) {
socket.destroy()
return;
}