mirror of
https://github.com/RoganDawes/P4wnP1_aloa.git
synced 2025-04-12 14:09:02 +02:00
Serve web-client on port 8000, to keep 80 usable
This commit is contained in:
parent
db0827e155
commit
39f0a933fc
@ -40,7 +40,7 @@ func main() {
|
||||
*/
|
||||
|
||||
// ToDo: The webroot has to be changed to /usr/local/P4wnP1/www
|
||||
service.StartRpcServerAndWeb("0.0.0.0", "50051", "80", "/usr/local/P4wnP1/www") //start gRPC service
|
||||
service.StartRpcServerAndWeb("0.0.0.0", "50051", "8000", "/usr/local/P4wnP1/www") //start gRPC service
|
||||
|
||||
//Indicate servers up with LED blink count 1
|
||||
state.Led.SetLed(&pb.LEDSettings{1})
|
||||
|
@ -432,6 +432,7 @@ func StartRpcServerAndWeb(host string, gRPCPort string, webPort string, absWebRo
|
||||
grpc_web_srv := grpcweb.WrapServer(s, grpcweb.WithWebsockets(true)) //Wrap server to improbable grpc-web with websockets
|
||||
//define a handler for a HTTP web server using the gRPC-web proxy
|
||||
http_gRPC_web_handler := func(resp http.ResponseWriter, req *http.Request) {
|
||||
//fmt.Printf("===========\nRequest: %s\n %v\n=============\n", req)
|
||||
if strings.Contains(req.Header.Get("Content-Type"), "application/grpc") ||
|
||||
req.Method == "OPTIONS" ||
|
||||
strings.Contains(req.Header.Get("Sec-Websocket-Protocol"), "grpc-websockets") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user