#how to expose my own http port and keep the custom HTTP response?

17 messages · Page 1 of 1 (latest)

simple hill
#

I want to use my own function and image directly. But I cannot find any guides about how to define a function without SDK runpod-python. Like how to let RunPod know which port to access?how to let RunPod directly return the http response?

#

how to expose my own http port and keep the custom HTTP response?

trim flare
#

Hi there, we currently do not support options for this at the moment

simple hill
#

Thanks for your reply. So if I can expose the http port by env RUNPOD_REALTIME_PORT in serverless Endpoint config?

trim flare
simple hill
#

In the serverless Endpoint creation page, I found that the "environment variables" can be added. Also, from SDK, the port can be set by RUNPOD_REALTIME_PORT. So I wonder if we can set the custom http port by it.
def _get_realtime_port() -> int:
"""
Get the realtime port from the environment variable if it exists.
"""
return int(os.environ.get("RUNPOD_REALTIME_PORT", "0"))

#

Also, I want to simulate the URL path "/realtime" in my own function, so I just need to change a little codes to deploy my own function in RunPod. I'm not sure if this can work since the reponse structure is different.

trim flare
#

You mean get the port

#

yeah, this should work

simple hill
#

Does RunPod need to analyze the response from my function ? Because the response structure is different.

loud sun
#

96+

trim flare
simple hill
#

I will try if it works. Thanks.

lilac wagon
#

Hi guys, any luck getting the /realtime endpoint to work?

agile owl
#

network ports are now allowed on serverless workers so should be possible.

lilac wagon
#

Oh really?? I'll try it now, thanks!