-
-
Save ismiyati/aedf6cd77fb923b756f908bd61e0ee60 to your computer and use it in GitHub Desktop.
This is a FastCGI example server in Go.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| location ~ /app.* { | |
| fastcgi_pass 127.0.0.1:9000; | |
| include fastcgi_params; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "net/http/fcgi" | |
| "net" | |
| ) | |
| type FastCGIServer struct{} | |
| func (s FastCGIServer) ServeHTTP(w http.ResponseWriter, req *http.Request) { | |
| w.Write([]byte("This is a FastCGI example server.\n")) | |
| } | |
| func main() { | |
| fmt.Println("Starting server...") | |
| l, _ := net.Listen("tcp", "127.0.0.1:9000") | |
| b := new(FastCGIServer) | |
| fcgi.Serve(l, b) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment