Skip to content

Commit

Permalink
change localhost to 127.0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aikoven committed Oct 14, 2023
1 parent d932913 commit a289151
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/nice-grpc-web/karma.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default (config: Config & Record<string, unknown>) => {
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');

Expand Down
2 changes: 1 addition & 1 deletion packages/nice-grpc-web/run-specs-jasmine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/nice-grpc-web/test-server/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function startRemoteTestServer(
proxyType: 'grpcwebproxy' | 'envoy' | 'traefik' = 'grpcwebproxy',
protocol: 'http' | 'https' = 'http',
): Promise<RemoteTestServer> {
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}`,
Expand Down
2 changes: 1 addition & 1 deletion packages/nice-grpc-web/test-server/grpcwebproxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
],
Expand Down

0 comments on commit a289151

Please sign in to comment.