简体   繁体   English

如何从CMD命令行运行Psiphon(仅适用于curl)?

[英]How to run Psiphon from CMD command line (for curl only)?

How to run Psiphon from command line (to connect to a proxy server) and make it be applied to curl only (keeping other programs' connections un-proxy-ed)? 如何从命令行运行Psiphon (以连接到代理服务器)并将其仅应用于curl(保持其他程序的连接不被代理)?

Purpose: 目的:
I'm using a script (written in perl) that uses curl by calling CMD command lines to perform web requests. 我正在使用一个脚本(用perl编写),该脚本通过调用CMD命令行执行Web请求来使用curl I am looking for using Psiphon also via CMD command line, this way the script could call CMD command lines to connect to a server and use curl through Psiphon proxy. 我也在寻找通过CMD命令行使用Psiphon的方式,这种脚本可以调用CMD命令行连接到服务器并通过Psiphon代理使用curl。

Note: 注意:
I need Psiphon proxy to be working for curl only, keeping my other programs' connections normal as is. 我需要Psiphon代理仅适用于curl ,使其他程序的连接保持原样。

My attempt for solution: 我的解决方案:
I've noticed that Psiphon uses an executable psiphon-tunnel-core.exe . 我注意到Psiphon使用了可执行的psiphon-tunnel-core.exe I tried to run this executable file from CMD it tells me {"data":{"data":{"message":"configuration file is required"},"noticeType":"Error","showUser":false,"timestamp":"2018-03-11T21:24:27.441Z"} 我尝试从CMD运行此可执行文件,它告诉我{"data":{"data":{"message":"configuration file is required"},"noticeType":"Error","showUser":false,"timestamp":"2018-03-11T21:24:27.441Z"}

Open cmd and type: 打开cmd并输入:

psiphon-tunnel-core.exe -help

You should be prompted the following: 应该提示您以下内容:

Usage of C:\Users\dell\Desktop\test\psiphon-tunnel-core.exe:
  -config string
        configuration input file
  -formatNotices
        emit notices in human-readable format
  -homepages string
        homepages notices output file
  -listenInterface string
        bind local proxies to specified interface
  -notices string
        notices output file (defaults to stderr)
  -rotating string
        rotating notices output file
  -rotatingFileSize int
        rotating notices file size (default 1048576)
  -rotatingSyncFrequency int
        rotating notices file sync frequency (default 100)
  -serverList string
        embedded server entry list input file
  -v    print build information and exit
  -version
        print build information and exit

I just like to add something from above. 我只想从上方添加一些内容。 Since you need Psiphon proxy to be working for curl only, the easiest way is start Psiphon3 main application (whichever command you want), then use proxifier/proxycap/freecap/widecap...to control which application uses your local proxy, or just use curl' --proxy flag (ie --proxy 127.0.0.1:8080). 由于您需要Psiphon代理仅适用于curl,因此最简单的方法是启动Psiphon3主应用程序(无论您要使用哪个命令),然后使用proxifier / proxycap / freecap / widecap ...来控制哪个应用程序使用您的本地代理,或者使用curl'--proxy标志(即--proxy 127.0.0.1:8080)。 Be sure you followed the SkipProxySettings registry instructions here: https://psiphon.ca/en/faq.html 确保您遵循此处的SkipProxySettings注册表说明: https ://psiphon.ca/en/faq.html

For the cmd query, in https://github.com/Psiphon-Labs/psiphon-tunnel-core , there's a simple script to run the consoleclient (psiphon-tunnel-core). 对于cmd查询,在https://github.com/Psiphon-Labs/psiphon-tunnel-core中 ,有一个简单的脚本可以运行consoleclient(psiphon-tunnel-core)。 Try placing the "consoleclient" in the Psiphon3 "Roaming" folder and run it from there. 尝试将“ consoleclient”放置在Psiphon3“ Roaming”文件夹中,然后从那里运行它。 Be sure that your http proxy port is the same as in the config file. 确保您的http代理端口与配置文件中的端口相同。 Configuration infos are found here in case you need it: https://godoc.org/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon#Config . 如果需要,可在此处找到配置信息: https : //godoc.org/github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon#Config The rest is all up to the user, but it's not recommended. 其余的一切由用户决定,但不建议这样做。 (And even if this works, you still need to control the proxy for curl "only".) (即使这可行,您仍然需要“仅”控制curl的代理。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM