== FDO OGC Integrated Proxy Server Support == === Overview === As a result of feedback from customers using the FDO API and the WMS/WFS Providers, a number of requests have arisen to allow access to Web services, such as WMS and WFS, through a proxy server. A proxy server acts as an intermediary between an internal network (Intranet) and the Internet, retrieving files from a remote web services. Proxy Server support can be enabled in the OSGeo Web Service providers by enhancing and expanding the connection parameter list that each provider supports. The following sections outline the additional connection properties that will be introduced in order to allow proxy server access. === Description === The following connection parameters will be added to the WMS and WFS connection string definitions. These properties will also appear in the Connection Property dictionary for each of these providers. ==== !ConnectionType ==== The !ConnectionType property defines the type of connection that will be used when connecting to the Web service. ||'''Property'''||'''Value'''|| ||Name||!ProxyConnectionType|| ||!LocalizedName||!ProxyConnectionType (English)|| ||!DefaultValue||!UseSystemSettings|| ||!IsRequired||No|| ||!IsProtected||No|| ||!IsEnumerable||Yes|| ||Enumerations||!UseDirectConnection|| ||||!UseSystemSettings|| ||||!UseProxyServer|| ||!IsFileName||No|| ||!IsFilePath||No|| ||!IsDatastoreName||No|| ''!UseSystemSettings'': Choose this option to use the LAN settings as defined by the operating system[[br]] ''!UseDirectConnection'': Choose this option to override the system LAN settings and connect directly to the Internet. (Not through a proxy server)[[br]] ''!UseProxyServer'': Choose this option to use the user-specified proxy server to connect to the Internet[[br]] On Windows you can review the current LAN settings by clicking Control Panel > Internet Options > Connections Tab > LAN Settings. This is the default connection setting. ==== !ProxyServerName ==== The !ProxyServerName property specifies the name of a user specified proxy server that will be used to make the connection to the external web service. ||'''Property'''||'''Value'''|| ||Name||!ProxyServerName|| ||!LocalizedName||!ProxyServerName (English)|| ||!DefaultValue|||| ||!IsRequired||No|| ||!IsProtected||No|| ||!IsEnumerable||No|| ||!IsFileName||No|| ||!IsFilePath||No|| ||!IsDatastoreName||No|| ==== !ProxyServerPort ==== The !ProxyServerPort property specifies the port of the user-specified proxy server that will be used to connect to the Internet. If set, it must be used in conjunction with the !ProxyServerName parameter. ||'''Property'''||'''Value'''|| ||Name||!ProxyServer|| ||!LocalizedName||!ProxyServer (English)|| ||!DefaultValue|||| ||!IsRequired||No|| ||!IsProtected||No|| ||!IsEnumerable||No|| ||!IsFileName||No|| ||!IsFilePath||No|| ||!IsDatastoreName||No|| ==== !ProxyServerUsername ==== The !ProxyServerUsername property specifies the username to be used when connecting to a user-specified proxy server. If set, it must be used in conjunction with the !ProxyServerName and !ProxyServerPassword parameters. ||'''Property'''||'''Value'''|| ||Name||!ProxyServerUsername|| ||!LocalizedName||!ProxyServerUsername (English)|| ||!DefaultValue|||| ||!IsRequired||No|| ||!IsProtected||No|| ||!IsEnumerable||No|| ||!IsFileName||No|| ||!IsFilePath||No|| ||!IsDatastoreName||No|| ==== !ProxyServerPassword ==== The !ProxyServerPassword property specifies the password to be used when connecting to a user-specified proxy server. If set, it must be used in conjunction with the !ProxyServerName and !ProxyServerPassword parameters. ||'''Property'''||'''Value'''|| ||Name||!ProxyServerPassword|| ||!LocalizedName||!ProxyServerPassword (English)|| ||!DefaultValue|||| ||!IsRequired||No|| ||!IsProtected||Yes|| ||!IsEnumerable||No|| ||!IsFileName||No|| ||!IsFilePath||No|| ||!IsDatastoreName||No|| ==== !ProxyBypassForLocal ==== The !ProxyBypassForLocal property specifies whether to use the proxy server for all local (intranet) addresses. Because a proxy server acts as a security barrier between an internal network (intranet) and the Internet, users could need extra permissions from your system administrator to gain access to Web pages through a proxy server. Users may be able to gain access to local addresses easier and faster without using a proxy server. ||'''Property'''||'''Value'''|| ||Name||!ProxyBypassForLocal|| ||!LocalizedName||!ProxyBypassForLocal(English)|| ||!DefaultValue||No|| ||!IsRequired||No|| ||!IsProtected||No|| ||!IsEnumerable||Yes|| ||Enumerations||True|| ||||False|| ||!IsFileName||No|| ||!IsFilePath||No|| ||!IsDatastoreName||No|| ==== Example Usage ==== The following are examples of how the connection properties specified above. ===== Use System Proxy Server Settings (Default) ===== The following is an example using FdoIConnection::!SetConnectionString. {{{ FdoPtr connection = GetConnection (); FdoStringP connString = L"FeatureServer=http://www.myserver.com/wfs; Username=guest; Password=guest; Version=1.1.1"); connection->SetConnectionString(connString); FdoConnectionState state = connection->Open (); }}} The following is an example using the FdoIConnectionPropertyDictionary. {{{ FdoPtr conn = GetConnection (); FdoPtr info = conn->GetConnectionInfo(); FdoPtr props = info->GetConnectionProperties(); props->SetProperty(L"FeatureServer", L"http://www.myserver.com/wfs"); props->SetProperty(L"Username", L"guest"); props->SetProperty(L"Password", L"guest"); props->SetProperty(L"Version", L"1.1.0"); FdoConnectionState state = connection->Open (); }}} ===== Use System Proxy Server Settings with Bypass ===== The following is an example using FdoIConnection::!SetConnectionString. {{{ FdoPtr connection = GetConnection (); FdoStringP connString = L"FeatureServer=http://www.myserver.com/wfs; Username=guest; Password=guest; Version=1.1.1; ProxyBypassForLocal=true"); connection->SetConnectionString(connString); FdoConnectionState state = connection->Open (); }}} The following is an example using the FdoIConnectionPropertyDictionary. {{{ FdoPtr conn = GetConnection (); FdoPtr info = conn->GetConnectionInfo(); FdoPtr props = info->GetConnectionProperties(); props->SetProperty(L"FeatureServer", L"http://www.myserver.com/wfs"); props->SetProperty(L"Username", L"guest"); props->SetProperty(L"Password", L"guest"); props->SetProperty(L"Version", L"1.1.0"); props->SetProperty(L"ProxyBypassForLocal", L"true"); FdoConnectionState state = connection->Open (); }}} ===== Use Direct Connection Server Settings ===== The following is an example using FdoIConnection::!SetConnectionString. {{{ FdoPtr connection = GetConnection (); FdoStringP connString = L"FeatureServer=http://www.myserver.com/wfs; Username=guest; Password=guest; Version=1.1.1; ConnectionType=UseDirectConnection"); connection->SetConnectionString(connString); FdoConnectionState state = connection->Open (); }}} The following is an example using the FdoIConnectionPropertyDictionary. {{{ FdoPtr conn = GetConnection (); FdoPtr info = conn->GetConnectionInfo(); FdoPtr props = info->GetConnectionProperties(); props->SetProperty(L"FeatureServer", L"http://www.myserver.com/wfs"); props->SetProperty(L"Username", L"guest"); props->SetProperty(L"Password", L"guest"); props->SetProperty(L"Version", L"1.1.0"); props->SetProperty(L"ConnectionType", L"UseDirectConnection"); FdoConnectionState state = connection->Open (); }}} ===== Use User-Specified Proxy Server ===== The following is an example using FdoIConnection::!SetConnectionString. {{{ FdoPtr connection = GetConnection (); FdoStringP connString = L"FeatureServer=http://www.myserver.com/wfs; Username=guest; Password=guest; Version=1.1.1; ConnectionType=UseProxyServer; ProxyServerName=Server123"); connection->SetConnectionString(connString); FdoConnectionState state = connection->Open (); }}} The following is an example using the FdoIConnectionPropertyDictionary. {{{ FdoPtr conn = GetConnection (); FdoPtr info = conn->GetConnectionInfo(); FdoPtr props = info->GetConnectionProperties(); props->SetProperty(L"FeatureServer", L"http://www.myserver.com/wfs"); props->SetProperty(L"Username", L"guest"); props->SetProperty(L"Password", L"guest"); props->SetProperty(L"Version", L"1.1.0"); props->SetProperty(L"ConnectionType", L"UseProxyServer"); props->SetProperty(L"ProxyServerName", L"Server123"); FdoConnectionState state = connection->Open (); }}} ===== Use User-Specified Proxy Server with Password ===== The following is an example using FdoIConnection::!SetConnectionString. {{{ FdoPtr connection = GetConnection (); FdoStringP connString = L"FeatureServer=http://www.myserver.com/wfs; Username=guest; Password=guest; Version=1.1.1; ConnectionType=UseProxyServer; ProxyServerName=Server123; ProxyServerPort=80; ProxyServerUsername=user1; ProxyServerPassword=pwd"); connection->SetConnectionString(connString); FdoConnectionState state = connection->Open (); }}} The following is an example using the FdoIConnectionPropertyDictionary. {{{ FdoPtr conn = GetConnection (); FdoPtr info = conn->GetConnectionInfo(); FdoPtr props = info->GetConnectionProperties(); props->SetProperty(L"FeatureServer", L"http://www.myserver.com/wfs"); props->SetProperty(L"Username", L"guest"); props->SetProperty(L"Password", L"guest"); props->SetProperty(L"Version", L"1.1.0"); props->SetProperty(L"ConnectionType", L"UseProxyServer"); props->SetProperty(L"ProxyServerName", L"Server123"); props->SetProperty(L"ProxyServerPort", L"80"); props->SetProperty(L"ProxyServerUsername", L"user1"); props->SetProperty(L"ProxyServerPassword", L"pwd"); FdoConnectionState state = connection->Open (); }}}