프로젝트의 app.config 파일에 서버 호스트 이름을 proxy bypass 하도록 한다.
IP주소든 도메인 이름이든 상관 없다.
<configuration>
<system.net>
<defaultProxy>
<bypasslist>
<add address="서버호스트이름(host name)" />
</bypasslist>
</defaultProxy>
</system.net>
</configuration>
---------------------------------------
append host name ( or ipaddress, domain name ) to bypass list
Saturday, March 26, 2016
Sunday, March 20, 2016
HttpWebRequest의 첫번째 동작이 느릴때. ( HttpWebRequest slow first time )
HttpWebRequest의 Proxy 설정을 null 로 해주면 해결된다.
HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create( URL );
httpRequest.Credentials = CredentialCache.DefaultCredentials;
httpRequest.Proxy = null;
httpRequest.Method = "GET";
httpRequest.KeepAlive = false;
HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();
System.IO.Stream dataStream = httpResponse.GetResponseStream();
System.IO.StreamReader streamReader = new System.IO.StreamReader(dataStream);
String responseText = streamReader.ReadToEnd();
dataStream.Close();
streamReader.Close();
httpResponse.Close();
-------------------
problem : very slow response when first request.
solution : assign null to Proxy attribute.
HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create( URL );
httpRequest.Credentials = CredentialCache.DefaultCredentials;
httpRequest.Proxy = null;
httpRequest.Method = "GET";
httpRequest.KeepAlive = false;
HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();
System.IO.Stream dataStream = httpResponse.GetResponseStream();
System.IO.StreamReader streamReader = new System.IO.StreamReader(dataStream);
String responseText = streamReader.ReadToEnd();
dataStream.Close();
streamReader.Close();
httpResponse.Close();
-------------------
problem : very slow response when first request.
solution : assign null to Proxy attribute.
Subscribe to:
Posts (Atom)