LSOpenURLsWithRole() failed with error -600 for the URL http://localhost:9000/.
This is the error I get when I try to launch my SimpleHTTPServer
while in a tmux
session. I'm a front-end web developer and I spend most of my time working with a SimpleHTTPServer
, rather than Apache
. The issue is that it errors out at the open
command, because I have the habit of opening files and directories from the terminal directly (open dirname/
, or open .
) , and when i use this in tmux
it gives me the same error.
I want to mention that I'm on a Macbook Air, running OSX 10.9 Mavericks.
This is the code of the function I use in my terminal to start the server:
# Start an HTTP server from a directory, optionally specifying the port
function server() {
local port="${1:-8000}"
open "http://localhost:${port}/"
# Set the default Content-Type to `text/plain` instead of `application/octet-stream`
# And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files)
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"
}
The issue doesn't appear anymore so I have 3 possible solutions for this:
Highly unlikely:
Most likely:
Not sure if this is the same case for you, since you mentioned you restarted a few times ...
However for me, I noticed that I had stray 2 tmux sessions after an iterm failure, which I had forgotten about. They were running a bunch of services started by grunt, so i'm assuming that one of these services was conflicting when trying to start again. Killing them made the bug not occur anymore and I was able to run my node app in tmux.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With