LoginSignup
0
1

More than 1 year has passed since last update.

Windows10 プロキシオプションをつけてcurlをたたく

Last updated at Posted at 2022-10-02

簡単なWebアクセス試験をしたくやり方を軽く検索したところ
windows10はcurlが標準搭載されているとのことだったので試してみる。

自身の環境がプロキシ経由でしかインターネットに抜けれないため
--proxyオプションをつけてアクセスできるか試してみる。

ちなみに搭載されているのはオープンソース版ではなく
マイクロソフトは一から作ったものらしい。
(マイクロソフトはオープンソースを使わないルールだとかなんとか)


curlがインストールされていることを確認する。
バージョンが表示されればOK。

curl --version
実行結果
>curl --version
curl 7.83.1 (Windows) libcurl/7.83.1 Schannel
Release-Date: 2022-05-13
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS HSTS IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI UnixSockets

proxyオプションをつけてcurlコマンドをgoogleにアクセスしてみる。

curl --proxy http://proxy****:8080 https://www.google.com
実行結果
C:\Users>curl --proxy http://proxy*****:8080/ https://www.google.com
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="ja"><head><meta content="&#19990;&#30028;&#20013;&#12398;&#12354;&#12425;&#12422;&#12427;&#24773;&#22577;&#12434;&#26908;&#32034;&#12377;&#12427;&#12383;&#12417;&#12398;&#12484;&#12540;&#12523;&#12434;&#25552;&#20379;&#12375;&#12390;&#12356;&#12414;&#12377;&#12290;&#12373;&#12414;&#12374;&#12414;&#12394;&#26908;&#32034;&#27231;&#33021;&#12434;&#27963;&#29992;&#12375;&#12390;&#12289;&#12362;&#25506;&#12375;&#12398;&#24773;&#22577;&#12434;&#35211;&#12388;&#12369;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;" name="description"><meta content="noodp" name="robots"><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta c
・
・
・

問題なくアクセスできました。

以上です、おつかれさまでした。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1