亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 3673 | 回復(fù): 7
打印 上一主題 下一主題

curl 的問題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2011-07-17 22:08 |只看該作者 |倒序?yàn)g覽
要寫個自動登錄的shell腳本,像haproxy這樣彈出式登錄的,要怎么寫:


請求頭信息如下:

論壇徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亞冠之浦和紅鉆
日期:2015-06-23 19:10:532015亞冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16賽季CBA聯(lián)賽之山東
日期:2016-01-31 18:25:0515-16賽季CBA聯(lián)賽之四川
日期:2016-02-16 16:08:30程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-06-29 06:20:002017金雞報曉
日期:2017-01-10 15:19:5615-16賽季CBA聯(lián)賽之佛山
日期:2017-02-27 20:41:19
2 [報告]
發(fā)表于 2011-07-18 08:11 |只看該作者

  1. 6. HTTP Authentication

  2. HTTP Authentication is the ability to tell the server your username and
  3. password so that it can verify that you're allowed to do the request you're
  4. doing. The Basic authentication used in HTTP (which is the type curl uses by
  5. default) is *plain* *text* based, which means it sends username and password
  6. only slightly obfuscated, but still fully readable by anyone that sniffs on
  7. the network between you and the remote server.

  8. To tell curl to use a user and password for authentication:

  9.         curl --user name:password http://www.example.com

  10. The site might require a different authentication method (check the headers
  11. returned by the server), and then --ntlm, --digest, --negotiate or even
  12. --anyauth might be options that suit you.

  13. Sometimes your HTTP access is only available through the use of a HTTP
  14. proxy. This seems to be especially common at various companies. A HTTP proxy
  15. may require its own user and password to allow the client to get through to
  16. the Internet. To specify those with curl, run something like:

  17.         curl --proxy-user proxyuser:proxypassword curl.haxx.se

  18. If your proxy requires the authentication to be done using the NTLM method,
  19. use --proxy-ntlm, if it requires Digest use --proxy-digest.

  20. If you use any one these user+password options but leave out the password
  21. part, curl will prompt for the password interactively.

  22. Do note that when a program is run, its parameters might be possible to see
  23. when listing the running processes of the system. Thus, other users may be
  24. able to watch your passwords if you pass them as plain command line
  25. options. There are ways to circumvent this.

  26. It is worth noting that while this is how HTTP Authentication works, very
  27. many web sites will not use this concept when they provide logins etc. See
  28. the Web Login chapter further below for more details on that.
復(fù)制代碼

論壇徽章:
0
3 [報告]
發(fā)表于 2011-07-18 09:08 |只看該作者
回復(fù) 2# waker


之前有在論壇這邊有看到這個的完整貼,現(xiàn)在沒找到了,呵呵~可否告訴下鏈接?

論壇徽章:
0
4 [報告]
發(fā)表于 2011-07-18 15:31 |只看該作者
回復(fù) 3# zhnghaijin


    CURL 是來填寫表單的...  要做這個認(rèn)證需要使用htpasswd ,

論壇徽章:
0
5 [報告]
發(fā)表于 2011-07-19 08:57 |只看該作者
回復(fù) 4# 南極雨

額...怎么做?提供個思路

論壇徽章:
0
6 [報告]
發(fā)表于 2011-07-19 09:38 |只看該作者
回復(fù) 5# zhnghaijin


建立網(wǎng)站根目錄,建立虛擬主機(jī)(可選)
htpasswd -c /etc/htpasswd.users(自定義路徑)  username
New password: (輸入密碼)
Re-type new password: (再輸入一次密碼)
Adding password for user username

然后在你的apache虛擬機(jī)配置文件中加入:

<Directory “DocumentRoot(網(wǎng)站的根目錄,一般為: /var/www/html)”>
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName “Site Access”
AuthType Basic
AuthUserFile /etc/htpasswd.users
Require valid-user
</Directory>


然后充氣apache , 應(yīng)該就可以了

論壇徽章:
0
7 [報告]
發(fā)表于 2011-07-23 15:41 |只看該作者
回復(fù) 6# 南極雨


    嗯,你說的是基于apache的認(rèn)證,但是這邊haproxy有自己的認(rèn)證方式.

論壇徽章:
0
8 [報告]
發(fā)表于 2011-07-24 22:55 |只看該作者
本帖最后由 南極雨 于 2011-07-24 23:03 編輯

回復(fù) 7# zhnghaijin


原理是一樣的...應(yīng)該是針對/etc/httpd/conf.d/proxy.conf 里面配置文件的所指向的目錄做一個認(rèn)證就可以了.

也有可能是用squid 做的.
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP