Edge Function access host name in development

My site name: gitwatch-dev

I am trying to write some edge functions and am using netlify dev --live for development.
I am using typescript for writing them.

I need to access the host of the app which i am getting by using the Request object received by the function through new URL(request.url).host. This works fine for the production deployment but for the development it returns localhost:8888 which makes sense.

How can i access the host in a way that works for both production and development (through netlify dev --live

Have you tried context.site: Edge Functions API | Netlify Docs?