Welcome to Portkey Forum

Updated 9 months ago

Running the AI Gateway on Replit

I am trying to run the AI gateway on Replit, but I tend to see an error from Replt that the app is not open to HTTP traffic. I did not deploy on Replit yet, just running it in development mode. I figured this is because, AI gateway tries to run the server on localhost (127.0.0.1), but Replit needs it to run it on 0.0.0.0. Where do I modify this in the AI gateway codebase?
V
S
v
3 comments
On this file: https://github.com/Portkey-AI/gateway/blob/33b11226983db6f1ae3721b4eb90e784a1662857/src/start-server.ts

Setting up hostname as '0.0.0.0' in the serve function should work?

Plain Text
serve({
  fetch: app.fetch,
  port: port,
  hostname: '0.0.0.0' 
})


Found some more info here: https://stackoverflow.com/questions/20778771/what-is-the-difference-between-0-0-0-0-127-0-0-1-and-localhost

cc @visarg if you want to check
I will try this
Yes. Vrushank's suggestion will work.
Add a reply
Sign up and join the conversation on Discord