Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: example configure hook #3600

Closed
wants to merge 2 commits into from
Closed

Conversation

yschimke
Copy link
Collaborator

Key line is really just

configure(address.socketFactory(), new Socket(proxy));

Question is whether OkHttp should support a configure hook for creating raw sockets, that is hit in all cases?

Currently a SocketFactory can be used to configure the socket created, except for when a SOCKS proxy is used.

    rawSocket = proxy.type() == Proxy.Type.DIRECT || proxy.type() == Proxy.Type.HTTP
        ? address.socketFactory().createSocket()
        : new Socket(proxy);

Configure hook options?

  1. poor OptionalMethod like below.
  2. an optional interface for SocketFactory supporting just a configureSocket method?

@yschimke
Copy link
Collaborator Author

relates to #3537

@yschimke
Copy link
Collaborator Author

Closing for now as it's not affecting me and SOCKS is a pretty obscure case

@yschimke yschimke closed this Sep 14, 2017
@yschimke yschimke deleted the configure_hook branch March 14, 2018 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant