Skip to content

Commit adb06a3

Browse files
authored
Emulator localhost updates, localhost -> 127.0.0.1 (#334)
* Update v8 and v9 for localhost -> 127.0.0.1 requirement. * Update Auth emulator snippets for localhost -> 127.0.0.1 requirement. * Update RTDB emulator snippet for localhost -> 127.0.0.1 requirement. * Update Storage emulator snippets for localhost -> 127.0.0.1 requirement. * More Database emulator snippet updates. * Update emulator-suite.js * Update emulator-suite.js * Update v8 and v9 for localhost -> 127.0.0.1 requirement. * Update Auth emulator snippets for localhost -> 127.0.0.1 requirement. * Update RTDB emulator snippet for localhost -> 127.0.0.1 requirement. * Update Storage emulator snippets for localhost -> 127.0.0.1 requirement. * More Database emulator snippet updates. * After running local script, new update file. * Test using "Delete" to remove file from PR, not repo * Put this file back.
1 parent 8fc7be2 commit adb06a3

File tree

15 files changed

+15
-15
lines changed

15 files changed

+15
-15
lines changed

auth-next/emulator-suite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function emulatorConnect() {
66
const { getAuth, connectAuthEmulator } = require("firebase/auth");
77

88
const auth = getAuth();
9-
connectAuthEmulator(auth, "http://localhost:9099");
9+
connectAuthEmulator(auth, "http://127.0.0.1:9099");
1010
// [END auth_emulator_connect]
1111
}
1212

auth/emulator-suite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "firebase/auth";
44
function emulatorConnect() {
55
// [START auth_emulator_connect]
66
const auth = firebase.auth();
7-
auth.useEmulator("http://localhost:9099");
7+
auth.useEmulator("http://127.0.0.1:9099");
88
// [END auth_emulator_connect]
99
}
1010

database-next/emulator-suite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function onDocumentReady() {
88
const db = getDatabase();
99
if (location.hostname === "localhost") {
1010
// Point to the RTDB emulator running on localhost.
11-
connectDatabaseEmulator(db, "localhost", 9000);
11+
connectDatabaseEmulator(db, "127.0.0.1", 9000);
1212
}
1313
// [END rtdb_emulator_connect]
1414
}

database/emulator-suite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function onDocumentReady() {
1010
var db = firebase.database();
1111
if (location.hostname === "localhost") {
1212
// Point to the RTDB emulator running on localhost.
13-
db.useEmulator("localhost", 9000);
13+
db.useEmulator("127.0.0.1", 9000);
1414
}
1515
// [END rtdb_emulator_connect]
1616
}

firestore-next/emulator-suite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ function onDocumentReady() {
77

88
// firebaseApps previously initialized using initializeApp()
99
const db = getFirestore();
10-
connectFirestoreEmulator(db, 'localhost', 8080);
10+
connectFirestoreEmulator(db, '127.0.0.1', 8080);
1111
// [END fs_emulator_connect]
1212
}

firestore/emulator-suite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function onDocumentReady() {
66
// Firebase previously initialized using firebase.initializeApp().
77
var db = firebase.firestore();
88
if (location.hostname === "localhost") {
9-
db.useEmulator("localhost", 8080);
9+
db.useEmulator("127.0.0.1", 8080);
1010
}
1111
// [END fs_emulator_connect]
1212
}

functions-next/emulator-suite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function emulatorSettings() {
1515
const { getFunctions, connectFunctionsEmulator } = require("firebase/functions");
1616

1717
const functions = getFunctions(getApp());
18-
connectFunctionsEmulator(functions, "localhost", 5001);
18+
connectFunctionsEmulator(functions, "127.0.0.1", 5001);
1919
// [END fb_functions_emulator_connect]
2020
}
2121

functions/emulator-suite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import "firebase/functions";
33

44
function emulatorSettings() {
55
// [START fb_functions_emulator_connect]
6-
firebase.functions().useEmulator("localhost", 5001);
6+
firebase.functions().useEmulator("127.0.0.1", 5001);
77
// [END fb_functions_emulator_connect]
88
}

snippets/auth-next/emulator-suite/auth_emulator_connect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
import { getAuth, connectAuthEmulator } from "firebase/auth";
99

1010
const auth = getAuth();
11-
connectAuthEmulator(auth, "http://localhost:9099");
11+
connectAuthEmulator(auth, "http://127.0.0.1:9099");
1212
// [END auth_emulator_connect_modular]

snippets/database-next/emulator-suite/rtdb_emulator_connect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ import { getDatabase, connectDatabaseEmulator } from "firebase/database";
1010
const db = getDatabase();
1111
if (location.hostname === "localhost") {
1212
// Point to the RTDB emulator running on localhost.
13-
connectDatabaseEmulator(db, "localhost", 9000);
13+
connectDatabaseEmulator(db, "127.0.0.1", 9000);
1414
}
1515
// [END rtdb_emulator_connect_modular]

snippets/firestore-next/emulator-suite/fs_emulator_connect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ import { getFirestore, connectFirestoreEmulator } from "firebase/firestore";
99

1010
// firebaseApps previously initialized using initializeApp()
1111
const db = getFirestore();
12-
connectFirestoreEmulator(db, 'localhost', 8080);
12+
connectFirestoreEmulator(db, '127.0.0.1', 8080);
1313
// [END fs_emulator_connect_modular]

snippets/functions-next/emulator-suite/fb_functions_emulator_connect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ import { getApp } from "firebase/app";
99
import { getFunctions, connectFunctionsEmulator } from "firebase/functions";
1010

1111
const functions = getFunctions(getApp());
12-
connectFunctionsEmulator(functions, "localhost", 5001);
12+
connectFunctionsEmulator(functions, "127.0.0.1", 5001);
1313
// [END fb_functions_emulator_connect_modular]

snippets/storage-next/emulator-suite/storage_emulator_connect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ import { getStorage, connectStorageEmulator } from "firebase/storage";
1010
const storage = getStorage();
1111
if (location.hostname === "localhost") {
1212
// Point to the Storage emulator running on localhost.
13-
connectStorageEmulator(storage, "localhost", 9199);
13+
connectStorageEmulator(storage, "127.0.0.1", 9199);
1414
}
1515
// [END storage_emulator_connect_modular]

storage-next/emulator-suite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function onDocumentReady() {
88
const storage = getStorage();
99
if (location.hostname === "localhost") {
1010
// Point to the Storage emulator running on localhost.
11-
connectStorageEmulator(storage, "localhost", 9199);
11+
connectStorageEmulator(storage, "127.0.0.1", 9199);
1212
}
1313
// [END storage_emulator_connect]
1414
}

storage/emulator-suite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function onDocumentReady() {
99
var storage = firebase.storage();
1010
if (location.hostname === "localhost") {
1111
// Point to the Storage emulator running on localhost.
12-
storage.useEmulator("localhost", 9199);
12+
storage.useEmulator("127.0.0.1", 9199);
1313
}
1414
// [END storage_emulator_connect]
1515
}

0 commit comments

Comments
 (0)