Live data from Hacker News

Bashbro – Make Any Comp a Web-Based File Server

github.com

1–10 of 52 posts

Re: Bashbro – Make Any Comp a Web-Based File Server

#6
go'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

#10
This 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?

Post reply on HN