> I guess that the options to run-server are mapped to the jetty
> options in some way, and the jetty config property seems to be called
> jetty.host, so I guessed that :host would work (to match jetty.port).
>
> Any help would be much appreciated.
Not quite. The Jetty wrapper only reads the :port option and a few
others related to SSL. You can pass a host name with the context ("/
*" -> "
http://localhost/*") but it doesn't actually use that to setup
Jetty so that doesn't really help. Setting the jetty.host system
property doesn't seem to work either. If you want it right away, you
can open up jetty.clj and change the create-server method to this:
(defn- create-server
"Construct a Jetty Server instance."
[options servlets]
(let [port (options :port 80)
connector (doto (SocketConnector.)
(.setPort port)
(.setHost (options :host)))
server (doto (Server.)
(.addConnector connector))
servlets (partition 2 servlets)]
(when (or (options :ssl) (options :ssl-port))
(add-ssl-connector! server options))
(doseq [[url-or-path servlet] servlets]
(add-servlet! server url-or-path servlet))
server))
Also add the following import to the ns at the top of the file:
(:import org.mortbay.jetty.bio.SocketConnector)
Recompile and pass a :host option as you were trying before and it'll
work.
Luke