diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 783fbfb..96d96e8 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -932,6 +932,34 @@ redirect_handler (SoupMessage *msg, gpointer user_data)
 	soup_session_requeue_message (session, msg);
 }
 
+/**
+* soup_session_get_address_for_uri:
+* @session: a #SoupSession
+* @uri: the #SoupURI whose #SoupAddress is requested
+*
+* Gets the #SoupAddress associated with @uri in @session.
+* Each #SoupSession stores one #SoupAddress for each host, so if two #SoupURI
+* have the same host, this function will return the same value.
+* If @session has no #SoupAddress associated with the host of @uri, %NULL will
+* be returned.
+*
+* Return value: a #SoupURI, or %NULL.
+*
+* Since: 2.30
+**/
+SoupAddress *
+soup_session_get_address_for_uri (SoupSession *session,
+			      SoupURI *uri)
+{
+	SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
+
+	SoupSessionHost *host = g_hash_table_lookup (priv->hosts, uri);
+	if (host) {
+		return host->addr;
+	} else
+		return NULL;
+}
+
 void
 soup_session_send_queue_item (SoupSession *session,
 			      SoupMessageQueueItem *item,
diff --git a/libsoup/soup-session.h b/libsoup/soup-session.h
index 598ee45..1adb523 100644
--- a/libsoup/soup-session.h
+++ b/libsoup/soup-session.h
@@ -93,6 +93,8 @@ void            soup_session_cancel_message   (SoupSession           *session,
 					       guint                  status_code);
 void            soup_session_abort            (SoupSession           *session);
 
+SoupAddress         *soup_session_get_address_for_uri (SoupSession *session,
+					       SoupURI *uri);
 
 void                soup_session_add_feature            (SoupSession        *session,
 							 SoupSessionFeature *feature);
