R
RunPod2mo ago
smile^v^

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

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?
9 Replies
River Snow
River Snow2mo ago
Hi there, we currently do not support options for this at the moment
smile^v^
smile^v^2mo ago
Thanks for your reply. So if I can expose the http port by env RUNPOD_REALTIME_PORT in serverless Endpoint config?
River Snow
River Snow2mo ago
Hi there Smile, could you clairfy your comment here further please?
smile^v^
smile^v^2mo ago
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.
River Snow
River Snow2mo ago
You mean get the port yeah, this should work
smile^v^
smile^v^2mo ago
Does RunPod need to analyze the response from my function ? Because the response structure is different.
digigoblin
digigoblin2mo ago
+ 96+
River Snow
River Snow2mo ago
I would recommend trial/error here, but I don't believe so
smile^v^
smile^v^2mo ago
I will try if it works. Thanks.