Skip to content

Commit 3e57151

Browse files
committed
Support connecting to IDACode from the browser
This setting is disabled per default
1 parent 133781d commit 3e57151

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

ida/idacode_utils/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
HOST = "127.0.0.1"
22
PORT = 7065
33
DEBUG_PORT = 7066
4+
ALLOW_UNSAFE_ORIGIN = False
5+
LOGGING = True
46

57
# Heuristically detect the python executable path
68
PYTHON = ""
@@ -26,5 +28,3 @@
2628
break
2729
if len(PYTHON) == 0 or not os.path.exists(PYTHON):
2830
raise FileNotFoundError("[IDACode] Could not find python executable, report an issue!")
29-
30-
LOGGING = True

ida/idacode_utils/socket_handler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ def start_debug_server():
3636
print("[IDACode] Started debugpy server on {}:{}".format(debugpy_host, debugpy_port))
3737

3838
class SocketHandler(tornado.websocket.WebSocketHandler):
39+
def check_origin(self, origin):
40+
# NOTE: This is called when connecting from a browser
41+
return settings.ALLOW_UNSAFE_ORIGIN
42+
3943
def open(self):
4044
print("[IDACode] Client connected")
4145

0 commit comments

Comments
 (0)