socketFactory

fun socketFactory(socketFactory: <Error class: unknown class>): OkHttpClient.Builder

Sets the socket factory used to create connections. OkHttp only uses the parameterless SocketFactory.createSocket method to create unconnected sockets. Overriding this method, e. g., allows the socket to be bound to a specific local address.

If unset, the SocketFactory.getDefault socket factory will be used.