on master help sign in
Bind to localhost
commitbf2844de5e2612a6c2ce962a91664da203b8aaf6 authorMichael <michael@snoyman.com> dateSun 29 May 2011, 09:13 (15 years ago) parent46dc4da
3 files changed+4−3
Network/Wai/Handler/Launch.hs+2−1 wai-handler-launch.cabal+1−1 windows.c+1−1
Network/Wai/Handler/Launch.hs+2−1
@@ -124,7 +124,7 @@ launch = forkIO (rawSystem
124124#else
125125 "xdg-open"
126126#endif
127− ["http://localhost:4587/"] >> return ()) >> return ()
127+ ["http://127.0.0.1:4587/"] >> return ()) >> return ()
128128#endif
129129
130130run :: Application -> IO ()
@@ -133,6 +133,7 @@ run app = do
133133 forkIO $ Warp.runSettings Warp.defaultSettings
134134 { Warp.settingsPort = 4587
135135 , Warp.settingsOnException = const $ return ()
136+ , Warp.settingsHost = "127.0.0.1"
136137 } $ ping x app
137138 launch
138139 loop x
wai-handler-launch.cabal+1−1
@@ -1,5 +1,5 @@
11Name: wai-handler-launch
2−Version: 0.0.0
2+Version: 0.0.1
33Synopsis: Launch a web app in the default browser.
44Description: This handles cross-platform launching and inserts Javascript code to ping the server. When the server no longer receives pings, it shuts down.
55License: BSD3
windows.c+1−1
@@ -3,5 +3,5 @@
33
44void launch(void)
55{
6− ShellExecute(NULL, "open", "http://localhost:4587/", NULL, NULL, SW_SHOWNORMAL);
6+ ShellExecute(NULL, "open", "http://127.0.0.1:4587/", NULL, NULL, SW_SHOWNORMAL);
77}