<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" >

  <channel>
    <title><![CDATA[Комментарии / Профиль hackvan]]></title>
    <link>https://habr.com/ru/users/hackvan/comments/</link>
    <description><![CDATA[Хабр: комментарии пользователя hackvan]]></description>
    <language>ru</language>
    <managingEditor>editor@habr.com</managingEditor>
    <generator>habr.com</generator>
    <pubDate>Tue, 05 May 2026 23:47:08 GMT</pubDate>
    
    
      <image>
        <link>https://habr.com/ru/</link>
        <url>https://habrastorage.org/webt/ym/el/wk/ymelwk3zy1gawz4nkejl_-ammtc.png</url>
        <title>Хабр</title>
      </image>
    

    
      

      
        
  
    <item>
      <title>22.11.2015 19:40:54 </title>
      <guid isPermaLink="true">https://habr.com/ru/articles/270283/#comment_8662529</guid>
      <link>https://habr.com/ru/articles/270283/#comment_8662529</link>
      <description><![CDATA[Ок. Понял, причесал код. В заголовке пусто. Странно конечно, может он по NTML пытается авторизоваться.<br/>
<pre><code class="dos">try {
  Invoke-WebRequest -Uri &quot;http://ya.ru&quot; -Proxy &quot;http://xx.xx.xx.xxx:xxxx&quot; -ProxyCredential(Get-Credential)
} catch {
        Write-Host -f Red &quot;Error: [$($_.Exception.Message)].&quot;
        break
}
</code></pre><br/>
Значит, так правильнее.<br/>
<pre><code class="dos">Invoke-WebRequest -Uri &quot;http://ya.ru&quot; -Proxy $Proxy -Headers $Headers
</code></pre>]]></description>
      <pubDate>Sun, 22 Nov 2015 19:40:54 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
    </item>
  

  
    <item>
      <title>22.11.2015 18:37:15 </title>
      <guid isPermaLink="true">https://habr.com/ru/articles/270283/#comment_8662493</guid>
      <link>https://habr.com/ru/articles/270283/#comment_8662493</link>
      <description><![CDATA[Согласен с вами по поводу пароля. «Расчехлил» tcpdump, попробывал еще 3proxy с basic авторизацией.<br/>
Провел 2 теста с 3proxy и squid.<br/>
<br/>
Тест 1.<br/>
<pre><code class="dos">$Proxy = &quot;http://xxx.xxx.xxx.xxx:xxxx&quot;
$ProxyCreds = &quot;user&quot;

$cred = Get-Credential $ProxyCreds
$UserName = $cred.UserName
$Password = $cred.GetNetworkCredential().Password

try {
  Invoke-WebRequest -Uri &quot;http://ya.ru&quot; -Proxy $Proxy -ProxyUseDefaultCredentials 
} catch {
        Write-Host -f Red &quot;Error: [$($_.Exception.Message)].&quot;
        break
}
</code></pre><br/>
<br/>
3proxy и squid ругнулись — 407, в HTTP заголовке отсутсвует Proxy-Authorization<br/>
<div class="spoiler"><b class="spoiler_title">HTTP заголовок в wireshark</b><div class="spoiler_text"><img src="https://habrastorage.org/getpro/habr/comment_images/780/3f0/2e5/7803f02e523325a9f95aeda575d6c3aa.png" alt="image"/><br/>
</div></div><br/>
Тест 2.<br/>
<pre><code class="dos">$Proxy = &quot;http://xxx.xxx.xxx.xxx:xxxx&quot;
$ProxyCreds = &quot;user&quot;

$cred = Get-Credential $ProxyCreds
$UserName = $cred.UserName
$Password = $cred.GetNetworkCredential().Password

$pair = &quot;$($UserName):$($Password)&quot;
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))

$Headers = @{
    'Proxy-Authorization' = &quot;Basic $encodedCreds&quot;
}

try {
  Invoke-WebRequest -Uri &quot;http://ya.ru&quot; -Proxy $Proxy -ProxyUseDefaultCredentials -Headers $Headers
} catch {
        Write-Host -f Red &quot;Error: [$($_.Exception.Message)].&quot;
        break
}
</code></pre><br/>
<br/>
Ура! Заработало. В HTTP заголовке уже появился Proxy-Authorization и basic авторизация прошла.<br/>
<div class="spoiler"><b class="spoiler_title">HTTP заголовок в wireshark</b><div class="spoiler_text"><img src="https://habrastorage.org/getpro/habr/comment_images/9de/183/896/9de183896ddd05211546e394393940b7.png" alt="image"/><br/>
</div></div><br/>
На этом варианте похоже я и остановлюсь.]]></description>
      <pubDate>Sun, 22 Nov 2015 18:37:15 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
    </item>
  

  
    <item>
      <title>22.11.2015 10:39:44 </title>
      <guid isPermaLink="true">https://habr.com/ru/articles/270283/#comment_8662297</guid>
      <link>https://habr.com/ru/articles/270283/#comment_8662297</link>
      <description><![CDATA[Сам отвечу на свой же вопрос. Получилось только так<br/>
<br/>
<pre><code class="dos">$ProxyUser = &quot;user&quot;
$ProxyPass = &quot;pass&quot;
$Proxy = &quot;http://xxx.xxx.xxx.xxx:xxxx&quot;

$url = 'http://www.adobe.com/ru/products/flashplayer/distribution3.html'

#Auth
$pair = &quot;$($ProxyUser):$($ProxyPass)&quot;
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))

#Proxy
$prox = new-object net.WebProxy;
$prox.Address = $Proxy

# Request
$req = [net.webRequest]::Create($url)
$req.method = &quot;GET&quot;
$req.Host = &quot;www.adobe.com&quot;
$req.UserAgent = &quot;Mozilla/5.0 (Windows NT 5.1; rv:42.0) Gecko/20100101 Firefox/42.0&quot;
$req.Proxy = $prox
$req.Headers['Proxy-Authorization'] = &quot;Basic $encodedCreds&quot;;


#Responce
$resp = $req.GetResponse()
$stream = new-object io.streamreader $resp.GetResponseStream()
$res = $stream.readtoend()
$res
</code></pre>]]></description>
      <pubDate>Sun, 22 Nov 2015 10:39:44 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
    </item>
  

  
    <item>
      <title>22.11.2015 05:54:35 </title>
      <guid isPermaLink="true">https://habr.com/ru/articles/270283/#comment_8662225</guid>
      <link>https://habr.com/ru/articles/270283/#comment_8662225</link>
      <description><![CDATA[А как заставить Invoke-WebRequest работать через squid<br/>
Пробывал: <br/>
<pre><code class="dos">    #$cred = Get-Credential $ProxyCreds
    $SecPass = ConvertTo-Securestring $ProxyPass -AsPlainText -Force 
    $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ProxyUser, $SecPass
    $WebrequestParams['ProxyCredential']=$cred
</code></pre><br/>
<br/>
Не пускает прокси. <br/>
<pre><code class="dos">Getting ADOBE server version (ESR)...FAIL!
Can't verify ADOBE server version! Error: [The remote server returned an error:
(407) Proxy Authentication Required.].
</code></pre>]]></description>
      <pubDate>Sun, 22 Nov 2015 05:54:35 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
    </item>
  

  
    <item>
      <title>21.11.2015 09:51:02 </title>
      <guid isPermaLink="true">https://habr.com/ru/companies/hpe/articles/198806/#comment_8661679</guid>
      <link>https://habr.com/ru/companies/hpe/articles/198806/#comment_8661679</link>
      <description><![CDATA[Стоит ли ожидать обновленный MicroServer Gen9 в 2016 году?]]></description>
      <pubDate>Sat, 21 Nov 2015 09:51:02 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
    </item>
  

  
    <item>
      <title>19.01.2009 19:44:14 </title>
      <guid isPermaLink="true">https://habr.com/ru/articles/49561/#comment_12938101</guid>
      <link>https://habr.com/ru/articles/49561/#comment_12938101</link>
      <description><![CDATA[мда… не ожидал увидеть такого на хабре. разочарован.]]></description>
      <pubDate>Mon, 19 Jan 2009 19:44:14 GMT</pubDate>
      <dc:creator><![CDATA[]]></dc:creator>
    </item>
  

      

      

    
  </channel>
</rss>
