Skip to content

Commit 2831f43

Browse files
committed
Server fixes
1 parent 8a553ed commit 2831f43

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

interpreter/core/async_core.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,20 @@ def run(self, retries=5, *args, **kwargs):
315315
print("SERVER STARTING")
316316

317317
if "host" in kwargs:
318-
self.host = kwargs["host"]
319-
318+
self.host = kwargs.pop("host")
320319
if "port" in kwargs:
321-
self.port = kwargs["port"]
320+
self.port = kwargs.pop("port")
321+
if "app" in kwargs:
322+
self.app = kwargs.pop("app")
323+
324+
if self.host == "0.0.0.0":
325+
print(
326+
"Warning: Using host `0.0.0.0` will expose Open Interpreter over your local network."
327+
)
328+
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
329+
s.connect(("8.8.8.8", 80)) # Google's public DNS server
330+
print(f"Server is running at http://{s.getsockname()[0]}:{self.port}")
331+
s.close()
322332

323333
for _ in range(retries):
324334
try:

0 commit comments

Comments
 (0)