From 22061141be18265dea79a7b56403f939ed6dd7f2 Mon Sep 17 00:00:00 2001 From: IsolatedSushi <simen.vanherpt@gmail.com> Date: Fri, 18 Sep 2020 00:57:04 +0200 Subject: [PATCH] trying to forward to dapr with envoy proxy --- envoy.yaml | 4 ++-- frontend/README.md | 2 +- frontend/src/components/gRPCDaprClient.vue | 11 ++++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/envoy.yaml b/envoy.yaml index b531033..b813217 100644 --- a/envoy.yaml +++ b/envoy.yaml @@ -2,7 +2,7 @@ static_resources: listeners: - name: listener_0 address: - socket_address: { address: 0.0.0.0, port_value: 8080 } + socket_address: { address: 0.0.0.0, port_value: 4949 } filter_chains: - filters: - name: envoy.http_connection_manager @@ -36,4 +36,4 @@ static_resources: type: logical_dns http2_protocol_options: {} lb_policy: round_robin - hosts: [{ socket_address: { address: host.docker.internal, port_value: 9090 }}] \ No newline at end of file + hosts: [{ socket_address: { address: 192.168.1.34, port_value: 50459 }}] \ No newline at end of file diff --git a/frontend/README.md b/frontend/README.md index ea0c8f8..3468848 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -9,4 +9,4 @@ For some reason with vue it cant get the dapr.HTTP environment variable (even th -docker run -d -v C:\Users\simen\OneDrive\Documents\GitHub\dummy-vue-grpc\envoy.yaml:/etc/envoy/envoy.yaml:ro -p 8080:8080 -p 50459:50459 envoyproxy/envoy:v1.15.0 \ No newline at end of file +docker run -d -v C:\Users\simen\OneDrive\Documents\GitHub\dummy-vue-grpc\envoy.yaml:/etc/envoy/envoy.yaml:ro -p 4949:4949 -p 50459:50459 envoyproxy/envoy:v1.15.0 \ No newline at end of file diff --git a/frontend/src/components/gRPCDaprClient.vue b/frontend/src/components/gRPCDaprClient.vue index 6ff583d..2ca4f44 100644 --- a/frontend/src/components/gRPCDaprClient.vue +++ b/frontend/src/components/gRPCDaprClient.vue @@ -30,13 +30,18 @@ export default { const daprPort = process.env.DAPR_HTTP_PORT || 5051; const dapr_url = "http://localhost:" + daprPort + "/v1.0/invoke/projector"; - var connection = axios.get(dapr_url + "/method/url"); - console.log(connection); + axios.get(dapr_url + "/method/url").then(response=> + { + console.log("Dapr backend running on: " + response.data["ip_address"]+":"+response.data["port"]); + } + + + ); var r = axios.post(dapr_url + "/method/start", 1).then((Response) => { if (Response.data["successful"]) { console.log("Grpc"); var connectURL = "http://" + Response.data["url"]; - connectURL = "http://192.168.1.34:8080" + connectURL = "http://0.0.0.0:4949" console.log(connectURL) var client = new ProjectorClient( connectURL, -- GitLab