diff options
author | Dahlia Trimble | 2009-02-06 01:25:59 +0000 |
---|---|---|
committer | Dahlia Trimble | 2009-02-06 01:25:59 +0000 |
commit | 28820e618502beac65f246e00509d845dbdfe5ba (patch) | |
tree | 1b406beba1250cca9d07d07c18752d4013939e76 /OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs | |
parent | * minor: remove mono compiler warning (diff) | |
download | opensim-SC-28820e618502beac65f246e00509d845dbdfe5ba.zip opensim-SC-28820e618502beac65f246e00509d845dbdfe5ba.tar.gz opensim-SC-28820e618502beac65f246e00509d845dbdfe5ba.tar.bz2 opensim-SC-28820e618502beac65f246e00509d845dbdfe5ba.tar.xz |
Thanks cmickyb for a patch (Mantis#3089) that adds support for proxy in http requests
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs index eeeb3ca..3d0afd1 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/LoadImageURL/LoadImageURLModule.cs | |||
@@ -43,6 +43,10 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL | |||
43 | private Scene m_scene; | 43 | private Scene m_scene; |
44 | private IDynamicTextureManager m_textureManager; | 44 | private IDynamicTextureManager m_textureManager; |
45 | 45 | ||
46 | private string m_proxyurl = ""; | ||
47 | private string m_proxyexcepts = ""; | ||
48 | |||
49 | |||
46 | #region IDynamicTextureRender Members | 50 | #region IDynamicTextureRender Members |
47 | 51 | ||
48 | public string GetName() | 52 | public string GetName() |
@@ -91,6 +95,8 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL | |||
91 | { | 95 | { |
92 | m_scene = scene; | 96 | m_scene = scene; |
93 | } | 97 | } |
98 | m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); | ||
99 | m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); | ||
94 | } | 100 | } |
95 | 101 | ||
96 | public void PostInitialise() | 102 | public void PostInitialise() |
@@ -121,6 +127,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.LoadImageURL | |||
121 | private void MakeHttpRequest(string url, UUID requestID) | 127 | private void MakeHttpRequest(string url, UUID requestID) |
122 | { | 128 | { |
123 | WebRequest request = HttpWebRequest.Create(url); | 129 | WebRequest request = HttpWebRequest.Create(url); |
130 | if (m_proxyurl.Length > 0) | ||
131 | { | ||
132 | if (m_proxyexcepts.Length > 0) { | ||
133 | string[] elist = m_proxyexcepts.Split(';'); | ||
134 | request.Proxy = new WebProxy(m_proxyurl,true,elist); | ||
135 | } else { | ||
136 | request.Proxy = new WebProxy(m_proxyurl,true); | ||
137 | } | ||
138 | } | ||
139 | |||
124 | RequestState state = new RequestState((HttpWebRequest) request, requestID); | 140 | RequestState state = new RequestState((HttpWebRequest) request, requestID); |
125 | // IAsyncResult result = request.BeginGetResponse(new AsyncCallback(HttpRequestReturn), state); | 141 | // IAsyncResult result = request.BeginGetResponse(new AsyncCallback(HttpRequestReturn), state); |
126 | request.BeginGetResponse(new AsyncCallback(HttpRequestReturn), state); | 142 | request.BeginGetResponse(new AsyncCallback(HttpRequestReturn), state); |