Guest User

Untitled

a guest
Jun 22nd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. private void initMeekTransport() {
  2. new MeekTransport().register();
  3.  
  4. Properties options = new Properties();
  5. String remoteAddress = "185.152.65.180:9001";// a public Tor guard to test
  6.  
  7. options.put(MeekTransport.OPTION_URL,"https://meek.azureedge.net/"); //the public Tor Meek endpoint
  8. options.put(MeekTransport.OPTION_FRONT, "ajax.aspnetcdn.com"); //the domain fronting address to use
  9. options.put(MeekTransport.OPTION_KEY, "97700DFE9F483596DDA6264C4D7DF7641E1E39CE"); //the key that is needed for this endpoint
  10.  
  11. init(DispatchConstants.PT_TRANSPORTS_MEEK, remoteAddress, options);
  12. }
  13.  
  14. Properties options = new Properties();
  15. String bridgeAddress = "https://meek.actualdomain.com";
  16. options.put(MeekTransport.OPTION_FRONT,"www.somefrontabledomain.com");
  17. options.put(MeekTransport.OPTION_KEY,"18800CFE9F483596DDA6264C4D7DF7331E1E39CE");
  18. init("meek", bridgeAddress, options);
  19. Transport transport = Dispatcher.get().getTransport(this, PT_TRANSPORTS_MEEK, options);
  20. if (transport != null)
  21. {
  22. Connection conn = transport.connect(bridgeAddress);
  23. //now use the connection, either as a proxy, or to read and write bytes directly
  24. if (conn.getLocalAddress() != null && conn.getLocalPort() != -1)
  25. setSocksProxy (conn.getLocalAddress(), conn.getLocalPort());
  26.  
  27.  
  28. ByteArrayOutputStream baos = new ByteArrayOutputStream();
  29. baos.write("GET https://somewebsite.org/TheProject.html HTTP/1.0".getBytes());
  30. conn.write(baos.toByteArray());
  31.  
  32. byte[] buffer = new byte[1024*64];
  33. int read = conn.read(buffer,0,buffer.length);
  34. String response = new String(buffer);
  35. }
Add Comment
Please, Sign In to add comment