hello there are programs that cast local addresses to online hosted instances with localtunnel, look into those I believe you need to enter the port number into the interface in a 178 IP and it will return an IP code and a web address to enter it into then it will launch the required accessible interface.
Here is an example of another method that will deliver the information directly in the collab notebook instance:
import threading
import time
import socket
def iframe_thread(port):
while True:
time.sleep(0.5)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('127.0.0.1', port))
if result == 0:
break
sock.close()
from google.colab import output
output.serve_kernel_port_as_iframe(port, height=1024)
print("to open it in a window you can open this link here:")
output.serve_kernel_port_as_window(port)
threading.Thread(target=iframe_thread, daemon=True, args=(8188,)).start()
!python main.py --dont-print-server
regards!
Riley