title: gRPC-web cannot connect to server (proxy configuration problem)
body: <p>I am trying to create a grpc-web client to connect to my grpc server. I already have my grpc server written in C++ and it works well with C# client, everything is okay and tested. Right now I am trying to create a js client to connect to my service. 
  So what I would expect is to return a simple "hello" back to me but what I get is: "net::ERR_CONNECTION_REFUSED".</p>
  
  <p>I have fallowed this tutorial: <a href="https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/helloworld" rel="nofollow noreferrer">hello world</a> and also tried that one: <a href="https://github.com/envoyproxy/envoy/tree/master/examples/front-proxy" rel="nofollow noreferrer">fron proxy from grpc-web</a></p>
  
  <p>I have generated proto files succesfuly. 
  my client looks like that: </p>
  
  <pre><code>const {HelloRequest, HelloResponse} = require('./definitions_pb.js');
  const {GreeterClient} = require('./definitions_grpc_web_pb.js');
  
  var echoService = new GreeterClient('http://192.168.88.150:8080');
  
  var request = new HelloRequest();
  request.setName('Mark');
  
  echoService.sayHello(request, {}, function(err, response) {
    // ...
  });
  </code></pre>
  
  <p>what I am confused about is the proxy that I have to run in docker, so I suspect it is messed up. My envoy.yaml file looks like that: </p>
  
  <pre><code>admin:
    access_log_path: /tmp/admin_access.log
    address:
      socket_address: { address: 0.0.0.0, port_value: 9091 }
  
  static_resources:
    listeners:
    - name: listener_0
      address:
        socket_address: { address: 0.0.0.0, port_value: 8080 }
      filter_chains:
      - filters:
        - name: envoy.http_connection_manager
          config:
            codec_type: auto
            stat_prefix: ingress_http
            route_config:
              name: local_route
              virtual_hosts:
              - name: local_service
                domains: ["*"]
                routes:
                - match: { prefix: "/" }
                  route:
                    cluster: greeter_service
                    max_grpc_timeout: 0s
                cors:
                  allow_origin:
                  - "*"
                  allow_methods: GET, PUT, DELETE, POST, OPTIONS
                  allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout
                  max_age: "1728000"
                  expose_headers: custom-header-1,grpc-status,grpc-message
                  enabled: true
            http_filters:
            - name: envoy.grpc_web
            - name: envoy.cors
            - name: envoy.router
    clusters:
    - name: greeter_service
      connect_timeout: 0.25s
      type: logical_dns
      http2_protocol_options: {}
      lb_policy: round_robin
      hosts: [{ socket_address: { address: 192.168.88.150, port_value: 50051 }}]
  </code></pre>
  
  <p>and Docker file:</p>
  
  <pre><code> FROM envoyproxy/envoy:latest
  COPY ./envoy.yaml /etc/envoy/envoy.yaml
  CMD /usr/local/bin/envoy -c /etc/envoy/envoy.yaml
  </code></pre>
  
  <p>I use " <code>npx webpack client.js</code> " to create main.js.</p>
  
  <p>To start envoy proxy I do as they say in the tutorial: </p>
  
  <pre><code>&gt;&gt; docker build -t envoy -f ./Dockerfile .
  &gt;&gt; docker run -d -p 8080:8080 envoy
  </code></pre>
  
  <p>and after starting my server, running that docker stuff and starting my web:</p>
  
  <pre><code>py -m http.server 8081
  </code></pre>
  
  <p>I get that error I have mentioned at the start. I was thinking of CORS blocking but it is enabled in the envoy file. I would really appreaciate any help.</p>
  
  <p>@@Edit</p>
  
  <p>So I have also tried that <a href="https://www.learnenvoy.io/articles/on-your-laptop.html" rel="nofollow noreferrer">envoy-front</a> and I have problems with <code>curl</code> instruction in that example. Mainly I get: <code>Invoke-WebRequest : Unable to connect to the remote server</code>. I susperct it has to do with my docker machine but I do not know what. Oh and also I am using Docker-Toolbox and not Docker for Windows because mym system does not support Docker for Windows.</p>