From de07390d844659524e289dcbda0434d6efaba53a Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Mon, 22 Jun 2009 20:33:05 +0000 Subject: [PATCH] Clarifying documentation on listen ips svn: r15235 --- collects/web-server/scribblings/running.scrbl | 1 + collects/web-server/scribblings/servlet-env-int.scrbl | 5 ++++- collects/web-server/scribblings/servlet-env.scrbl | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/collects/web-server/scribblings/running.scrbl b/collects/web-server/scribblings/running.scrbl index e496697faf..a8a5ba5d08 100644 --- a/collects/web-server/scribblings/running.scrbl +++ b/collects/web-server/scribblings/running.scrbl @@ -25,6 +25,7 @@ web-server/insta ] And press @onscreen["Run"]. A Web browser will open up showing your new servlet. +This servlet will only be accessible from your local machine. Behind the scenes, DrScheme has used @scheme[serve/servlet] to start a new server that uses your @scheme[start] function as the servlet. diff --git a/collects/web-server/scribblings/servlet-env-int.scrbl b/collects/web-server/scribblings/servlet-env-int.scrbl index 4de5445070..8bbbb53d2c 100644 --- a/collects/web-server/scribblings/servlet-env-int.scrbl +++ b/collects/web-server/scribblings/servlet-env-int.scrbl @@ -63,7 +63,10 @@ These functions optimize the construction of dispatchers and launching of server If @scheme[banner?] is true, then a banner is printed informing the user of the server's URL. - The server listens on @scheme[listen-ip] and port @scheme[port]. + The server listens on @scheme[listen-ip] and port @scheme[port]. If @scheme[listen-ip] is @scheme[#f], then the server accepts + connections to all of the listening machine's addresses. Otherwise, the server accepts connections only at the interface(s) associated with the given string. + For example, providing @scheme["127.0.0.1"] (the default) as @scheme[listen-ip] creates a server that accepts only connections to @scheme["127.0.0.1"] (the loopback interface) from the local machine. + If @scheme[ssl-key] and @scheme[ssl-cert] are not false, then the server runs in HTTPS mode with @scheme[ssl-cert] and @scheme[ssl-key] as paths to the certificate and private key. diff --git a/collects/web-server/scribblings/servlet-env.scrbl b/collects/web-server/scribblings/servlet-env.scrbl index 37bc889d8e..12165b6835 100644 --- a/collects/web-server/scribblings/servlet-env.scrbl +++ b/collects/web-server/scribblings/servlet-env.scrbl @@ -39,6 +39,12 @@ Suppose you'd like to change the port to something else, change the last line to #:port 8080) ] +Suppose you want to accept connections from external machines: +@schemeblock[ +(serve/servlet my-app + #:listen-ip #f) +] + By default the URL for your servlet is @filepath{http://localhost:8000/servlets/standalone.ss}, suppose you wanted it to be @filepath{http://localhost:8000/hello.ss}: @schemeblock[ @@ -155,7 +161,9 @@ and if @scheme[serve/servlet] is run in another module. Advanced users may need the following options: - The server listens on @scheme[listen-ip] and port @scheme[port]. + The server listens on @scheme[listen-ip] and port @scheme[port]. If @scheme[listen-ip] is @scheme[#f], then the server accepts + connections to all of the listening machine's addresses. Otherwise, the server accepts connections only at the interface(s) associated with the given string. + For example, providing @scheme["127.0.0.1"] (the default) as @scheme[listen-ip] creates a server that accepts only connections to @scheme["127.0.0.1"] (the loopback interface) from the local machine. If @scheme[ssl-cert] and @scheme[ssl-key] are not false, then the server runs in HTTPS mode with @scheme[ssl-cert] and @scheme[ssl-key] as the certificates and private keys.