-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDemo.gd
More file actions
18 lines (14 loc) · 701 Bytes
/
Copy pathDemo.gd
File metadata and controls
18 lines (14 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extends Node2D
var config = {
# Add full config data here
"url":"" # For demo purposes, I use my Firebase database URL
}
func _ready():
var sub_url = "" # Add the "/sub_list_url" stuff here, including query parameters as needed; for demo purposes, I use the list path in my Firebase database, combined with ".json?auth=" and whatever the auth token is.
$HTTPSSEClient.connect("connected", self, "on_connected")
$HTTPSSEClient.connect_to_host(config.url, sub_url, 443, true, false)
func on_connected():
$HTTPSSEClient.connect("new_sse_event", self, "on_new_sse_event")
func on_new_sse_event(headers, event, data):
print("event is: " + event)
print("data is: " + data)