<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/Foundation/URLSessionConfiguration/ephemeralConfiguredForTor(socksEndpoint:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Tor",
      "Foundation"
    ],
    "preciseIdentifier" : "s:So25NSURLSessionConfigurationC3TorE022ephemeralConfiguredForC013socksEndpointAbC8HostPortV_tFZ"
  },
  "title" : "ephemeralConfiguredForTor(socksEndpoint:)"
}
-->

# ephemeralConfiguredForTor(socksEndpoint:)

Build an ephemeral `URLSessionConfiguration` that routes every
HTTP/HTTPS request through a SOCKS5 proxy.

```
static func ephemeralConfiguredForTor(socksEndpoint endpoint: HostPort) -> URLSessionConfiguration
```

## Parameters

`endpoint`

SOCKS5 proxy endpoint, typically
[`socksEndpoint`](/documentation/Tor/TorClient/socksEndpoint).

## Return Value

An ephemeral configuration with the SOCKS5 proxy
installed.

## Discussion

Starts from `URLSessionConfiguration.ephemeral` (no disk
persistence of cookies, caches, or credentials) and installs
the same SOCKS5 proxy dictionary as
[`configuredForTor(socksEndpoint:)`](/documentation/Tor/Foundation/URLSessionConfiguration/configuredForTor(socksEndpoint:)). Preferred for
one-shot or privacy-sensitive traffic where session state
should not survive process exit.

> Note: Ephemeral sessions still share Apple’s in-memory URL
> cache for the process lifetime; subsequent requests for the
> same URL may short-circuit. Set `config.urlCache = nil` if
> strict no-cache behaviour is required.