wiki:FdoOGCProxyServerSupport

Version 1 (modified by gregboone, 17 years ago) ( diff )

--

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.

PropertyValue
NameProxyConnectionType
LocalizedNameProxyConnectionType (English)
DefaultValueUseSystemSettings
IsRequiredNo
IsProtectedNo
IsEnumerableYes
EnumerationsUseDirectConnection
UseSystemSettings
UseProxyServer
IsFileNameNo
IsFilePathNo
IsDatastoreNameNo

UseSystemSettings: Choose this option to use the LAN settings as defined by the operating system
UseDirectConnection: Choose this option to override the system LAN settings and connect directly to the Internet. (Not through a proxy server)
UseProxyServer: Choose this option to use the user-specified proxy server to connect to the Internet

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.

PropertyValue
NameProxyServerName
LocalizedNameProxyServerName (English)
DefaultValue
IsRequiredNo
IsProtectedNo
IsEnumerableNo
IsFileNameNo
IsFilePathNo
IsDatastoreNameNo

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.

PropertyValue
NameProxyServer
LocalizedNameProxyServer (English)
DefaultValue
IsRequiredNo
IsProtectedNo
IsEnumerableNo
IsFileNameNo
IsFilePathNo
IsDatastoreNameNo

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.

PropertyValue
NameProxyServerUsername
LocalizedNameProxyServerUsername (English)
DefaultValue
IsRequiredNo
IsProtectedNo
IsEnumerableNo
IsFileNameNo
IsFilePathNo
IsDatastoreNameNo

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.

PropertyValue
NameProxyServerPassword
LocalizedNameProxyServerPassword (English)
DefaultValue
IsRequiredNo
IsProtectedYes
IsEnumerableNo
IsFileNameNo
IsFilePathNo
IsDatastoreNameNo

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.

PropertyValue
NameProxyBypassForLocal
LocalizedNameProxyBypassForLocal(English)
DefaultValueNo
IsRequiredNo
IsProtectedNo
IsEnumerableYes
EnumerationsTrue
False
IsFileNameNo
IsFilePathNo
IsDatastoreNameNo

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<FdoIConnection> 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<FdoIConnection> conn = GetConnection ();
FdoPtr<FdoIConnectionInfo> info = conn->GetConnectionInfo();
FdoPtr<FdoIConnectionPropertyDictionary> 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<FdoIConnection> 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<FdoIConnection> conn = GetConnection ();
FdoPtr<FdoIConnectionInfo> info = conn->GetConnectionInfo();
FdoPtr<FdoIConnectionPropertyDictionary> 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<FdoIConnection> 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<FdoIConnection> conn = GetConnection ();
FdoPtr<FdoIConnectionInfo> info = conn->GetConnectionInfo();
FdoPtr<FdoIConnectionPropertyDictionary> 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<FdoIConnection> 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<FdoIConnection> conn = GetConnection ();
FdoPtr<FdoIConnectionInfo> info = conn->GetConnectionInfo();
FdoPtr<FdoIConnectionPropertyDictionary> 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<FdoIConnection> 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<FdoIConnection> conn = GetConnection ();
FdoPtr<FdoIConnectionInfo> info = conn->GetConnectionInfo();
FdoPtr<FdoIConnectionPropertyDictionary> 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 ();
Note: See TracWiki for help on using the wiki.