A proxy agent of a private network for dynamically setting up a session between a target resource in the private network and an application on a device, wherein the device belongs to the private network but may be located remotely from the private network, the application is configured to send a request to a server in the private network to get the target resource and the server is configured to authorize a user of the device to authorize access to the server and a Universal Resource Locator, URL of a session anchor is identified by the server, the proxy agent comprising an input/output section configured to receive a request to instantiate the proxy agent with address information of the identified session anchor, to send a session request to the session anchor, and to receive a session URL from the session anchor, wherein the proxy agent further comprises a memory configured to store a mapping between said session URL and the target resource, and the input/output section is further configured to send the session URL to the server, such that the server can forward the session URL to the client, and to receive a request from the client via the session URL of the session anchor to get the target resource, wherein the proxy agent further comprises a processor configured to map the session URL to the URL of the target resource, and the input/output section is further configured to send a request to get the target resource, such that the target resource can be sent to the client.