Permalink
Browse files

Added :host support for Jetty adapter

  • Loading branch information...
1 parent 8eb0886 commit 5fd010e602c2f71f34393f20fb8dc772d6563558 @weavejester weavejester committed Jul 29, 2009
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/ring/adapter/jetty.clj
View
@@ -1,6 +1,7 @@
(ns ring.adapter.jetty
(:import (org.mortbay.jetty.handler AbstractHandler)
(org.mortbay.jetty Server)
+ (org.mortbay.jetty.bio SocketConnector)
(org.mortbay.jetty.security SslSocketConnector))
(:use (ring.util servlet)
(clojure.contrib except)))
@@ -32,11 +33,14 @@
(defn- create-server
"Construct a Jetty Server instance."
[options]
- (let [port (options :port 80)
- server (Server. port)]
+ (let [connector (doto (SocketConnector.)
+ (.setPort (options :port 80))
+ (.setHost (options :host)))
+ server (doto (Server.)
+ (.addConnector connector)
+ (.setSendDateHeader true))]
(when (or (options :ssl) (options :ssl-port))
(add-ssl-connector! server options))
- (.setSendDateHeader true)
server))
(defn run-jetty

0 comments on commit 5fd010e

Please sign in to comment.