【问题标题】:How to access content from secured website via proxy tunnel without authentication required如何通过代理隧道从安全网站访问内容而无需身份验证
【发布时间】:2015-06-09 07:39:46
【问题描述】:

我想从需要身份验证的站点抓取/下载竞争。为此,我需要在我的 CLI / Node.js 应用程序和安全网站之间建立一些隧道,而无需任何身份验证。请查看架构:

Scraper / downloader app -> [no passowrd] -> some proxy -> user (login) -> secured website with login / authentication

知道怎么做吗?

【问题讨论】:

  • 安全网站接受什么样的身份验证?
  • 我怎样才能知道呢?

标签: proxy web-scraping http-proxy tunnel tunneling


【解决方案1】:

根据目标站点处理身份验证的方式,您的问题可以通过设置一个简单的node-http-proxy 应用程序来解决。

这可能是解决方案(从文档中复制粘贴并修改):

var http = require('http'),
httpProxy = require('http-proxy');

var proxy = httpProxy.createProxyServer({});

var server = http.createServer(function(req, res) {
  // Your mileage may vary here.
  req.setHeader("Authentication", "Basic mysecrettoken=");
  proxy.web(req, res, { target: 'http://127.0.0.1:5060' });
});

server.listen(5050);

更多信息请参见https://github.com/nodejitsu/node-http-proxy。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-18
    • 2017-04-27
    • 2010-11-24
    相关资源
    最近更新 更多