Skip to content

Instantly share code, notes, and snippets.

@kevinherron
Created September 14, 2010 01:02
Show Gist options
  • Save kevinherron/578362 to your computer and use it in GitHub Desktop.
Save kevinherron/578362 to your computer and use it in GitHub Desktop.
package com.kevinherron.campfire.playground;
import com.ning.http.client.AsyncHandler;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.AsyncHttpClientConfig;
import com.ning.http.client.HttpResponseBodyPart;
import com.ning.http.client.HttpResponseHeaders;
import com.ning.http.client.HttpResponseStatus;
import com.ning.http.client.Realm;
import com.ning.http.client.Request;
public class Problem {
public static void main(String[] args) throws Exception {
AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
.setRequestTimeoutInMs(Integer.MAX_VALUE)
.setIdleConnectionTimeoutInMs(Integer.MAX_VALUE)
.build();
AsyncHttpClient client = new AsyncHttpClient(config);
Realm realm = new Realm.RealmBuilder()
.setPrincipal("REMOVED")
.setPassword("X")
.build();
Request streamRequest = client
.prepareGet("https://streaming.campfirenow.com/room/316301/live.json")
.setRealm(realm)
.build();
client.executeRequest(streamRequest);
// Give it time to actually connect...
Thread.sleep(5000);
System.out.println("Closing client...");
client.close();
System.out.println("...Done.");
System.out.println("Exiting...");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment