Bashbro – Make Any Comp a Web-Based File Server
1–10 of 52 posts
Re: Bashbro – Make Any Comp a Web-Based File Server
#2[deleted]
Re: Bashbro – Make Any Comp a Web-Based File Server
#3Nice job.
You can do it in python with python -m http.server also!
Re: Bashbro – Make Any Comp a Web-Based File Server
#4[deleted]
Re: Bashbro – Make Any Comp a Web-Based File Server
#5Nice job. You can do it in python with python -m http.server also!
Related: list of web server one-liners https://gist.github.com/willurd/5720255
Re: Bashbro – Make Any Comp a Web-Based File Server
#6go's version is this which is my favorite because a single http server serving static files is cool but it's better to program it to do what you want.
package main
import (
"net/http"
"os"
)
func main() {
if err := http.ListenAndServe(os.Args[1], http.FileServer(http.Dir(os.Args[2]))); err != nil {
panic(err)
}
}Re: Bashbro – Make Any Comp a Web-Based File Server
#7In case you're wondering the same thing I was, it uses socat to listen on the port
Re: Bashbro – Make Any Comp a Web-Based File Server
#8What is wrong with "python -m http.server"?
Re: Bashbro – Make Any Comp a Web-Based File Server
#9What is wrong with "python -m http.server"?
It requires Python.
Bashbro, on the other hand, seems to require socat. I wonder if there's any bash-istic method of listening to a port...
Re: Bashbro – Make Any Comp a Web-Based File Server
#10This is cool, but there's currently an overload of ports assigned on my system.
Is there a way to manage all these port numbers? And why can't we use strings, even if just locally?
And what do people use to allocate port numbers in a way that you'll never get clashes?