Guest User

Untitled

a guest
Dec 12th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. Authenticator.setDefault(new Authenticator() {
  2. @Override
  3. protected PasswordAuthentication getPasswordAuthentication() {
  4. return new PasswordAuthentication("userName", "S&nh@".toCharArray());
  5. }
  6. });
  7.  
  8. final OkHttpClient client = new OkHttpClient.Builder()
  9. .proxy(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("127.0.0.123", 1080)))
  10. . build();
  11.  
  12. Authenticator.setDefault(new Authenticator() {
  13. @Override
  14. protected PasswordAuthentication getPasswordAuthentication() {
  15. return new PasswordAuthentication(USER, PASSWORD.toCharArray());
  16. }
  17. });
  18.  
  19. retrofit = new Retrofit.Builder()
  20. .client(client)
  21. .baseUrl(URL)
  22. .addConverterFactory(GsonConverterFactory.create())
  23. .build();
Add Comment
Please, Sign In to add comment