diff --git a/packages/nice-grpc-web/karma.conf.ts b/packages/nice-grpc-web/karma.conf.ts index 60c12d22..5a351830 100644 --- a/packages/nice-grpc-web/karma.conf.ts +++ b/packages/nice-grpc-web/karma.conf.ts @@ -50,7 +50,7 @@ export default (config: Config & Record) => { certPath = path.resolve(__dirname, './test-server/cert/tls.crt'); keyPath = path.resolve(__dirname, './test-server/cert/tls.key'); } else { - hostname = 'localhost'; + hostname = '127.0.0.1'; certPath = path.resolve(__dirname, './test-server/cert/self-signed.crt'); keyPath = path.resolve(__dirname, './test-server/cert/self-signed.key'); diff --git a/packages/nice-grpc-web/run-specs-jasmine.ts b/packages/nice-grpc-web/run-specs-jasmine.ts index 216d80bb..f229db9b 100644 --- a/packages/nice-grpc-web/run-specs-jasmine.ts +++ b/packages/nice-grpc-web/run-specs-jasmine.ts @@ -29,7 +29,7 @@ jasmine.addReporter(new SpecReporter()); const certPath = path.resolve(__dirname, './test-server/cert/self-signed.crt'); const keyPath = path.resolve(__dirname, './test-server/cert/self-signed.key'); -const hostname = 'localhost'; +const hostname = '127.0.0.1'; const cert = selfsigned.generate([{name: 'commonName', value: hostname}], { keySize: 2048, }); diff --git a/packages/nice-grpc-web/test-server/client.ts b/packages/nice-grpc-web/test-server/client.ts index 260eac21..8525b82b 100644 --- a/packages/nice-grpc-web/test-server/client.ts +++ b/packages/nice-grpc-web/test-server/client.ts @@ -26,7 +26,7 @@ export async function startRemoteTestServer( proxyType: 'grpcwebproxy' | 'envoy' | 'traefik' = 'grpcwebproxy', protocol: 'http' | 'https' = 'http', ): Promise { - const hostname = globalThis.location?.hostname ?? 'localhost'; + const hostname = globalThis.location?.hostname ?? '127.0.0.1'; const ws = new WebSocket( `ws://${hostname}:3000/mock-server?proxy=${proxyType}&protocol=${protocol}`, diff --git a/packages/nice-grpc-web/test-server/grpcwebproxy.ts b/packages/nice-grpc-web/test-server/grpcwebproxy.ts index a2ad10a8..80f4683c 100644 --- a/packages/nice-grpc-web/test-server/grpcwebproxy.ts +++ b/packages/nice-grpc-web/test-server/grpcwebproxy.ts @@ -30,7 +30,7 @@ export async function startGrpcWebProxy( : [`--server_http_debug_port=${listenPort}`, `--run_tls_server=false`]), `--server_bind_address=0.0.0.0`, - `--backend_addr=localhost:${backendPort}`, + `--backend_addr=127.0.0.1:${backendPort}`, `--use_websockets=true`, `--allow_all_origins=true`, ],