by jokeofweek on 9/22/13, 12:50 PM with 18 comments
by tptacek on 9/22/13, 3:38 PM
I know it's possible to pull select() into Golang programs (I ended up having to, to write a fast port scanner), but Golang people look at you weirdly when you tell them you did that.
by mcot2 on 9/22/13, 1:45 PM
// The booleans representing the free active connection spaces.
spaces := make(chan bool, *maxConnections)
// Initialize the spaces
for i := 0; i < *maxConnections; i++ {
spaces <- true
}
}Is this really how people use go???
by farslan on 9/22/13, 8:37 PM
package main
import (
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
target, _ := url.Parse("http://127.0.0.1:8000")
http.ListenAndServe(":80", httputil.NewSingleHostReverseProxy(target))
}
This will http proxy :80 to :8000.