Add auth-key for node registration
This commit is contained in:
@@ -9,8 +9,13 @@ func InitWebsocket():
|
||||
while socket.get_ready_state() != WebSocketPeer.STATE_OPEN:
|
||||
socket.poll()
|
||||
|
||||
|
||||
socket.send_text(str({"register": 1}))
|
||||
var init_message = {
|
||||
"register": {
|
||||
"version": 1,
|
||||
"auth_key": $"/root/Main".auth_key
|
||||
}
|
||||
}
|
||||
socket.send_text(str(init_message))
|
||||
print("Connected")
|
||||
while true:
|
||||
await PollWebsocket()
|
||||
|
||||
2
Main.gd
2
Main.gd
@@ -5,6 +5,7 @@ var config = ConfigFile.new()
|
||||
var websocket_url
|
||||
var public_path
|
||||
var output_dir
|
||||
var auth_key
|
||||
var rendering = false
|
||||
signal finished_rendering
|
||||
|
||||
@@ -14,6 +15,7 @@ func _ready():
|
||||
websocket_url = config.get_value("core", "websocket_url")
|
||||
public_path = config.get_value("core", "public_path")
|
||||
output_dir = config.get_value("core", "output_dir")
|
||||
auth_key = config.get_value("core", "auth_key")
|
||||
print("Starting render node")
|
||||
|
||||
var directory = DirAccess.open(".")
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
[core]
|
||||
auth_key=ay1234
|
||||
websocket_url="ws://localhost:6980"
|
||||
public_path="http://localhost:8899/"
|
||||
output_dir="./output"
|
||||
|
||||
Reference in New Issue
Block a user