Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void initMeekTransport() {
- new MeekTransport().register();
- Properties options = new Properties();
- String remoteAddress = "185.152.65.180:9001";// a public Tor guard to test
- options.put(MeekTransport.OPTION_URL,"https://meek.azureedge.net/"); //the public Tor Meek endpoint
- options.put(MeekTransport.OPTION_FRONT, "ajax.aspnetcdn.com"); //the domain fronting address to use
- options.put(MeekTransport.OPTION_KEY, "97700DFE9F483596DDA6264C4D7DF7641E1E39CE"); //the key that is needed for this endpoint
- init(DispatchConstants.PT_TRANSPORTS_MEEK, remoteAddress, options);
- }
- Properties options = new Properties();
- String bridgeAddress = "https://meek.actualdomain.com";
- options.put(MeekTransport.OPTION_FRONT,"www.somefrontabledomain.com");
- options.put(MeekTransport.OPTION_KEY,"18800CFE9F483596DDA6264C4D7DF7331E1E39CE");
- init("meek", bridgeAddress, options);
- Transport transport = Dispatcher.get().getTransport(this, PT_TRANSPORTS_MEEK, options);
- if (transport != null)
- {
- Connection conn = transport.connect(bridgeAddress);
- //now use the connection, either as a proxy, or to read and write bytes directly
- if (conn.getLocalAddress() != null && conn.getLocalPort() != -1)
- setSocksProxy (conn.getLocalAddress(), conn.getLocalPort());
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- baos.write("GET https://somewebsite.org/TheProject.html HTTP/1.0".getBytes());
- conn.write(baos.toByteArray());
- byte[] buffer = new byte[1024*64];
- int read = conn.read(buffer,0,buffer.length);
- String response = new String(buffer);
- }
Add Comment
Please, Sign In to add comment