awslabs / llrt

LLRT (Low Latency Runtime) is an experimental, lightweight JavaScript runtime designed to address the growing demand for fast and efficient Serverless applications.
Apache License 2.0
8.05k stars 355 forks source link

HTTP proxy authent with fetch #273

Open nocquidant opened 6 months ago

nocquidant commented 6 months ago

Hi, sometimes I need to attach one of my Lambdas to a VPC to access private ressources like ALB... And then, I have to specify an HTTP proxy to be able to access the Internet (security requirement). But as far I as know, fetch doesn't support HTTP proxy with authentication out of the box. Do you have some guidelines here to make this use case work? Thanks! --nick

nocquidant commented 6 months ago

It would be nice if variables: HTTP_PROXY, HTTPS_PROXY and NO_PROXY could be supported out of the box. As bun did: https://github.com/oven-sh/bun/issues/1440 (or Deno) My understanding is that it is not supported yet in Node: https://github.com/nodejs/undici/issues/1650 Would import the unidici dependency work (and configure the proxy agent)?

richarddavison commented 6 months ago

Hi @nocquidant. So you wan't fetch to route request via a proxy configured via HTTP(s)_PROXY? How would you configure auth? Meanwhile, can you use something like s_client to work around that?

nocquidant commented 6 months ago

Hi, thanks for your response! The HTTP(s)_PROXY URL supports credentials: http_proxy=http://user:password@proxy:port/ Humm, so I guess s_client would be installed via layer? Not very convenient and doesn't the layer affect cold starts?

richarddavison commented 6 months ago

Thanks, we will add this!

nocquidant commented 4 months ago

Hi, any chance of implementing this in near future? I 'll need it for my next project. Thanks (just asking)