mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 08:03:13 +09:00
Merge masterIP and masterPort into masterURL
Merge the masterIP and masterPort configuration entries into a single masterURL entry. Fixes the problem with connecting to an HTTPS version of the master server and also makes it easier to host the master server behind a reverse proxy. This breaks all known code interfacing Clusterio.
This commit is contained in:
1 parent
da99b39402
commit
98900e72dc
15 files changed
+68
-43
No files matched your search
@@ -50,7 +50,7 @@ class ResearchSync {
|
||||
}
|
||||
|
||||
initial_request_own_data(callback) {
|
||||
const url = `${this.config.masterIP}:${this.config.masterPort}/api/getSlaveMeta`
|
||||
const url = `${this.config.masterURL}/api/getSlaveMeta`
|
||||
const data = {
|
||||
instanceID: this.config.unique,
|
||||
password: this.config.clientPassword,
|
||||
@@ -102,7 +102,7 @@ class ResearchSync {
|
||||
}
|
||||
|
||||
request_cluster_data() {
|
||||
const slaves_data_url = `${this.config.masterIP}:${this.config.masterPort}/api/slaves`
|
||||
const slaves_data_url = `${this.config.masterURL}/api/slaves`
|
||||
needle.get(slaves_data_url, {compressed:true}, this.sync_researches.bind(this))
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ class ResearchSync {
|
||||
|
||||
this.print_own_contribution()
|
||||
|
||||
needle.post(this.config.masterIP + ':' + this.config.masterPort + '/api/editSlaveMeta', {
|
||||
needle.post(this.config.masterURL + '/api/editSlaveMeta', {
|
||||
instanceID: this.config.unique,
|
||||
password: this.config.clientPassword,
|
||||
meta: {research: this.research}
|
||||
|
||||
@@ -12,8 +12,7 @@ describe("researchSync/index.js", function() {
|
||||
|
||||
const config = {
|
||||
instanceName: "test",
|
||||
masterIP: "localhost",
|
||||
masterPort: 8080,
|
||||
masterURL: "http://localhost:8080",
|
||||
unique: 99,
|
||||
clientPassword: "password",
|
||||
masterAuthToken: "masterToken",
|
||||
|
||||
Reference in new issue
Block a user