Allow to configure listening interface

This commit is contained in:
Yves
2025-03-12 15:26:03 +01:00
parent 963e0e4d4c
commit 7a619f806c
5 changed files with 28 additions and 6 deletions

View File

@@ -40,7 +40,8 @@ private:
friend class Watcher;
// Lifecycle
void DoStart(const uint16_t local_port, const std::string &remote_url);
void DoStart(const uint16_t local_port, const std::string &local_host,
const std::string &remote_url);
void DoStop();
void Run();
void UpdateDatabaseInstance(shared_ptr<DatabaseInstance> context_db);
@@ -69,6 +70,7 @@ private:
shared_ptr<DatabaseInstance> LockDatabaseInstance();
uint16_t local_port;
std::string local_host;
std::string local_url;
std::string remote_url;
weak_ptr<DatabaseInstance> ddb_instance;

View File

@@ -5,6 +5,8 @@
#define UI_LOCAL_PORT_SETTING_NAME "ui_local_port"
#define UI_LOCAL_PORT_SETTING_DEFAULT 4213
#define UI_LOCAL_HOST_SETTING_NAME "ui_local_host"
#define UI_LOCAL_HOST_SETTING_DEFAULT "localhost"
#define UI_REMOTE_URL_SETTING_NAME "ui_remote_url"
#define UI_REMOTE_URL_SETTING_DEFAULT "https://ui.duckdb.org"
#define UI_POLLING_INTERVAL_SETTING_NAME "ui_polling_interval"
@@ -27,6 +29,7 @@ T GetSetting(const ClientContext &context, const char *setting_name) {
std::string GetRemoteUrl(const ClientContext &);
uint16_t GetLocalPort(const ClientContext &);
std::string GetLocalHost(const ClientContext &);
uint32_t GetPollingInterval(const ClientContext &);
} // namespace duckdb