diff options
author | Wolfy-J <[email protected]> | 2018-05-31 14:10:59 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-05-31 14:10:59 +0300 |
commit | 48f4f7a39a2336be24cc74b4116c02cc941dbd9a (patch) | |
tree | 3de1d379e43fe0772fb699852eac08ded6bbe644 /cmd | |
parent | ec2af29c17402145547699e719902d0f3f2ec8ec (diff) |
http support
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/rr-php/cmd/serve.go | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/cmd/rr-php/cmd/serve.go b/cmd/rr-php/cmd/serve.go index dc15b6df..ce19414b 100644 --- a/cmd/rr-php/cmd/serve.go +++ b/cmd/rr-php/cmd/serve.go @@ -20,7 +20,7 @@ import ( "os/exec" "time" "github.com/sirupsen/logrus" - "github.com/spiral/roadrunner/server" + rrhttp "github.com/spiral/roadrunner/http" "net/http" ) @@ -40,9 +40,10 @@ func serveHandler(cmd *cobra.Command, args []string) { ) err := rr.Configure(roadrunner.Config{ - NumWorkers: 1, + NumWorkers: 4, AllocateTimeout: time.Minute, DestroyTimeout: time.Minute, + //MaxExecutions: 10, }) rr.Observe(func(event int, ctx interface{}) { @@ -55,8 +56,25 @@ func serveHandler(cmd *cobra.Command, args []string) { logrus.Info("serving") - http.ListenAndServe(":8080", server.NewHTTP( - server.HTTPConfig{ + //Enable http2 + //srv := http.Server{ + // Addr: ":8080", + // Handler: rrhttp.NewServer( + // rrhttp.Config{ + // ServeStatic: true, + // Root: "/Users/wolfy-j/Projects/phpapp/webroot", + // }, + // rr, + // ), + //} + + // srv.ListenAndServe() + + //http2.ConfigureServer(&srv, nil) + //srv.ListenAndServeTLS("localhost.cert", "localhost.key") + + http.ListenAndServe(":8080", rrhttp.NewServer( + rrhttp.Config{ ServeStatic: true, Root: "/Users/wolfy-j/Projects/phpapp/webroot", }, |