From c6c73cf73139f304825959f6e4d4819df1cb285d Mon Sep 17 00:00:00 2001 From: PunKeel Date: Sat, 28 Mar 2015 21:46:08 +0100 Subject: [PATCH] Fix okhttp AccessControlException --- .../com/imaginarycode/minecraft/redisbungee/RedisBungee.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungee.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungee.java index bf90a41..e59df14 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungee.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/RedisBungee.java @@ -14,6 +14,7 @@ import com.imaginarycode.minecraft.redisbungee.events.PubSubMessageEvent; import com.imaginarycode.minecraft.redisbungee.util.NameFetcher; import com.imaginarycode.minecraft.redisbungee.util.UUIDFetcher; import com.imaginarycode.minecraft.redisbungee.util.UUIDTranslator; +import com.squareup.okhttp.Dispatcher; import com.squareup.okhttp.OkHttpClient; import lombok.Getter; import lombok.NonNull; @@ -434,6 +435,8 @@ public final class RedisBungee extends Plugin { public Void call() throws Exception { service = Executors.newFixedThreadPool(16); httpClient = new OkHttpClient(); + Dispatcher dispatcher = new Dispatcher(service); + httpClient.setDispatcher(dispatcher); NameFetcher.setHttpClient(httpClient); UUIDFetcher.setHttpClient(httpClient); return null;