File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -356,15 +356,18 @@ class UptimeKumaApi(object):
356
356
357
357
:param str url: The url to the Uptime Kuma instance. For example ``http://127.0.0.1:3001``
358
358
:param float wait_timeout: How many seconds the client should wait for the connection., defaults to 1
359
+ :param dict headers: Headers that are passed to the socketio connection, defaults to None
359
360
:raises UptimeKumaException: When connection to server failed.
360
361
"""
361
362
def __init__ (
362
363
self ,
363
364
url : str ,
364
- wait_timeout : float = 1
365
+ wait_timeout : float = 1 ,
366
+ headers : dict = None
365
367
) -> None :
366
368
self .url = url
367
369
self .wait_timeout = wait_timeout
370
+ self .headers = headers
368
371
self .sio = socketio .Client ()
369
372
370
373
self ._event_data : dict = {
@@ -541,7 +544,7 @@ def connect(self) -> None:
541
544
"""
542
545
url = self .url .rstrip ("/" )
543
546
try :
544
- self .sio .connect (f'{ url } /socket.io/' , wait_timeout = self .wait_timeout )
547
+ self .sio .connect (f'{ url } /socket.io/' , wait_timeout = self .wait_timeout , headers = self . headers )
545
548
except :
546
549
raise UptimeKumaException ("unable to connect" )
547
550
You can’t perform that action at this time.
0 commit comments