goproxy icon indicating copy to clipboard operation
goproxy copied to clipboard

Can I proxy request to another host?

Open fallenleavesguy opened this issue 3 years ago • 2 comments

Can I proxy request to another host? If URL match some rules, just access host2.com and return the response of host2.com when user is accessing host1.com.

fallenleavesguy avatar Nov 30 '21 00:11 fallenleavesguy

Yes, I think you can just modify req.Host in your handler.

CoolSpring8 avatar Nov 30 '21 12:11 CoolSpring8

add handler. and return a new Response

suxianbaozi avatar Dec 01 '21 06:12 suxianbaozi