Default address for requests after registering a route

Hello. I’m having a lot of fun with Omniverse! Everything that I tested so far worked really well.

The only thing I couldn’t find for now in docs or reading the source code what’s the address you need to make a request to when you’re using omni.services.core. I tried:

  • localhost:[8080,3009,3010,8000]
  • omniverse://localhost…

But none of them work.

In an extension on_startup:

from omni.services.core import main

async def get_stage():
    uri = omni.usd.get_context().get_stage_url()
    return {"file_uri": uri}

main.register_endpoint("get", "/stage", get_stage)

And making the request from Creator’s script editor:

omni.kit.pipapi.install("requests") 
import requests

s = requests.Session()

r = s.get("http://localhost:3080/stage")
print(r.text)

I have the same problem with omni.services.usd.

I’m using the default installation. Cache/Web/System Monitor/Connection from a different PC, everything works fine.

This is probably a simple answer, thanks.

Answering my own question: omni.services.transport.server.http[s] gives you an HTTP server. The default port is 8011.

Thanks.

1 Like