diff --git a/collects/help/launch.ss b/collects/help/launch.ss index 44adcedf78..2c83efdabf 100644 --- a/collects/help/launch.ss +++ b/collects/help/launch.ss @@ -17,7 +17,7 @@ (require (lib "web-server.ss" "web-server") (lib "web-config-unit.ss" "web-server") "private/config.ss" - "private/internal-hp.ss" + (only "private/internal-hp.ss" internal-host) "private/options.ss") (helpdesk-platform 'external-browser) @@ -27,7 +27,7 @@ (serve/web-config@ config)) (printf "\nStart here: http://~a:~a/servlets/home.ss\n\n" - internal-host internal-port) + internal-host (internal-port)) (printf "Press enter to shutdown.\n") (read-line) diff --git a/collects/help/private/internal-hp.ss b/collects/help/private/internal-hp.ss index 9d1ab94fd0..468c84c912 100644 --- a/collects/help/private/internal-hp.ss +++ b/collects/help/private/internal-hp.ss @@ -1,7 +1,8 @@ (module internal-hp mzscheme (require (lib "dirs.ss" "setup") - (lib "config.ss" "planet")) - (provide internal-port + (lib "config.ss" "planet") + "options.ss") + (provide (rename internal-port* internal-port) is-internal-host? internal-host collects-hosts collects-dirs doc-hosts doc-dirs @@ -12,8 +13,8 @@ ;; The general idea is that there's one "virtual" host for ;; every filesystem tree that we need to access. ;; (now we use static.ss/host/yadayda instead of the virtual - ; host docX.localhost, but we still need to keep track of - ; the file system roots) + ;; host docX.localhost, but we still need to keep track of + ;; the file system roots) ;; The "get-help-url.ss" library provides a function to ;; convert a path into a suitable URL (i.e., a URL using ;; the right virtual host). @@ -24,7 +25,11 @@ ;; URLs.) (define internal-host "localhost") - (define internal-port 8012) + ;; fake an internal-port binding (actually a parameter in options.ss) + (define-syntax internal-port* + (syntax-id-rules () + [(x . xs) ((internal-port) . xs)] + [x (internal-port)])) (define (is-internal-host? str) (member str all-internal-hosts)) diff --git a/collects/help/private/options.ss b/collects/help/private/options.ss index 545cc1007a..d3e54d264a 100644 --- a/collects/help/private/options.ss +++ b/collects/help/private/options.ss @@ -15,4 +15,8 @@ ;; 'external-browser )) + ;; Port for the server to listen on + ;; (relevant only for a standalone server) + (define internal-port (make-parameter 8012)) + )