Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

235
Visualizações
Proxied Browser Requests with Cookies through a node server

What I am trying to achieve is displaying html content to a user from another server (external server That I do not own) that is normally accessed through a browser.

To get the right html to display to the user, cookies related to that server's domain must be provided.

APPROACH 1:

Easiest approach I tried is using an iframe. And of course, I got the usual CSP error from the chrome console:

Refused to frame '{{URL}}' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' {{ACCEPTED DOMAINS}}".

APPROACH 2:

I made a local proxy server in node.js and tried to setup a proxied request in browser axios:

axios.get("{{URL to external server}}", { proxy: { host: "localhost", port: 5050 }});

I quickly realized that axios proxy is a node only feature per this issue.

CONCLUSION:

I can't find a way to make a GET request to get html in a browser to a cookie protected and CSP protected server/domain. If I am able to display html in the first place, I can probably use the same system to show a login page to update the user's cookies. Just a heads up I am using react / node.js.

If you know of a better approach that completely scraps away my code or uses a different technology, please share!

Thank you in advance.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda