A TCP Issue with ZeroTurst

An issue I am experiencing with connecting to our development database.

Elobrated

Dev A in Israel and a Dev B in the USA. While Dev A members in Israel can successfully connect to the development database and work on local applications, Dev B from the USA are encountering difficulties when trying to connect through local applications.

What do I mean?
The DB in question is MongoDB. Both Dev A and Dev B are able to connect to MongoDB Compass (A free UI application to manage MongoDB databases) the DB is running on a docker

They are both using the same command cloudflared access tcp --hostname mongo-dev-discord.mydomain.com --url localhost:3436
When Dev A is developing the app, his application is able to connect to the DB.
But when Dev B is developing the app, his application can't connect to the DB.

This is the code, that the app is running...
const uri = "mongodb://localhost:3436";
const { MongoClient } = require('mongodb');

const mClient = new MongoClient(uri);

async function connectToDatabase() {
    try {
        await mClient.connect();
        console.log("Connected to MongoDB");
        return mClient.db('Bot');
    } catch (error) {
        console.error("Error connecting to MongoDB:", error);
        throw error;
    }
}

connectToDatabase();


Dev A can connect when he runs it, but Dev B gets this error Error connecting to MongoDB: MongoServerSelectionError: connect ECONNREFUSED ::1:3436
and the most important thing both are able to connect to the DB using MongoDB Compass
ad59a665-440c-4a69-a48e-0b77ed52d804.png
Was this page helpful?