You cannot (to my knowledge) serve anything from within the sandbox (what would clients even connect to?).
You can however make an abstracted transport layer, that uses events in the sandbox (for testing single player), and websocket locally (for true multiplayer). But your current architecture doesn’t look like it’s quite ready for that yet.
There might be other ways to do it, but I am fairly certain, that you are out of luck, if you want to host/connect to games directly inside the sandbox.
In general, yes - you can make multiplayer games in AIStudio Build, but you have to think it all the way through and accept the limitations of developing within a sandboxed environment.
Would have to write an entire essay to explain step by step how to make it work in Build, so just going to give you some high-level pointers, and leave it to you to figure out the rest (just ask a LLM).
Treat the entire application as a client/server application.
Abstract the transport layer in the application to support event-driven (sandbox) or websocket (live) transport.
Be mindful of NodeJS imports in the sandbox (http, ws, etc.) as they will bring the sandbox to its knees - you need clever workarounds for that.
There should be examples online for how to do this, or, again, just ask a LLM.