You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.
I'm trying to create a proxy that by default simply forwards all requests to server the client originally intended to, so it looks like client -> server from the client's point of view, even tho there is proxy between them, but also is able to change request parameters, like headers and URL if configured to do so. I've written code to redirect /favicon.ico GET requests to a different .ICO on a different domain from what is requested (say, mysite.net/favicon.ico to example.com/icons/icon.ico), and the problem is that I seemingly randomly get the correct resource back from example.com, but other times I get no response at all, silently.
Example log of events as recorded by the proxy, the format is: first morgan line before request is examined and maybe modified, then it's details, then morgan line after all possible actions; the first part is the failed request, while the other, identical to the first, goes through successfully:
::ffff:127.0.0.1 - GET http://127.0.0.1/favicon.ico HTTP/1.1 - - - - ms
Proxy request: http://findicons.com/files/icons/2619/social_icons/77/github.png to host findicons.com
{ host: 'findicons.com',
'proxy-connection': 'keep-alive',
pragma: 'no-cache',
'cache-control': 'no-cache',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.111 Safari/537.36 Vivaldi/1.8.770.44',
accept: 'image/webp,image/*,*/*;q=0.8',
dnt: '1',
'accept-encoding': 'gzip, deflate, sdch, br',
'accept-language': 'ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4',
'x-forwarded-for': '192.168.0.0',
'x-real-ip': '192.168.0.0' }
::ffff:127.0.0.1 - GET http://findicons.com/files/icons/2619/social_icons/77/github.png HTTP/1.1 - - - - ms
::ffff:127.0.0.1 - GET http://127.0.0.1/favicon.ico HTTP/1.1 - - - - ms
Proxy request: http://findicons.com/files/icons/2619/social_icons/77/github.png to host findicons.com
{ host: 'findicons.com',
'proxy-connection': 'keep-alive',
pragma: 'no-cache',
'cache-control': 'no-cache',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.111 Safari/537.36 Vivaldi/1.8.770.44',
accept: 'image/webp,image/*,*/*;q=0.8',
dnt: '1',
'accept-encoding': 'gzip, deflate, sdch, br',
'accept-language': 'ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4',
'x-forwarded-for': '192.168.0.0',
'x-real-ip': '192.168.0.0' }
::ffff:127.0.0.1 - GET http://findicons.com/files/icons/2619/social_icons/77/github.png HTTP/1.1 - - - - ms
Proxy response: http://127.0.0.1/favicon.ico with status 200
{ server: 'nginx/1.1.19',
date: 'Wed, 29 Mar 2017 04:33:07 GMT',
'content-type': 'image/png',
'content-length': '9850',
'last-modified': 'Sun, 19 Aug 2012 06:35:42 GMT',
connection: 'close',
'accept-ranges': 'bytes' }
I'm trying to create a proxy that by default simply forwards all requests to server the client originally intended to, so it looks like
client -> server
from the client's point of view, even tho there is proxy between them, but also is able to change request parameters, like headers and URL if configured to do so. I've written code to redirect/favicon.ico
GET requests to a different .ICO on a different domain from what is requested (say,mysite.net/favicon.ico
toexample.com/icons/icon.ico
), and the problem is that I seemingly randomly get the correct resource back fromexample.com
, but other times I get no response at all, silently.Example log of events as recorded by the proxy, the format is: first
morgan
line before request is examined and maybe modified, then it's details, thenmorgan
line after all possible actions; the first part is the failed request, while the other, identical to the first, goes through successfully:My code for the proxy:
Am I doing this wrong? Why does it work occasionally?
The text was updated successfully, but these errors were encountered: