|
|
|
@ -34,6 +34,8 @@ import net.dv8tion.jda.api.managers.AudioManager; |
|
|
|
|
import net.dv8tion.jda.api.requests.GatewayIntent; |
|
|
|
|
import net.dv8tion.jda.api.utils.Compression; |
|
|
|
|
import net.dv8tion.jda.api.utils.cache.CacheFlag; |
|
|
|
|
import net.dv8tion.jda.internal.utils.IOUtil; |
|
|
|
|
import okhttp3.OkHttpClient; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The Chords music Discord bot. |
|
|
|
@ -108,6 +110,9 @@ public final class Chords extends ListenerAdapter |
|
|
|
|
{ |
|
|
|
|
final WebSocketFactory webSocketFactory = new WebSocketFactory(); |
|
|
|
|
final LocalBindSocketFactory localBindSocketFactory = new LocalBindSocketFactory(); |
|
|
|
|
OkHttpClient.Builder httpBuilder = IOUtil.newHttpClientBuilder(); |
|
|
|
|
httpBuilder.socketFactory(localBindSocketFactory); |
|
|
|
|
|
|
|
|
|
localBindSocketFactory.setLocalAddress(InetAddress.getByName(settings.getLocalAddr())); |
|
|
|
|
webSocketFactory.setSocketFactory(localBindSocketFactory); |
|
|
|
|
builder.setWebsocketFactory(webSocketFactory); |
|
|
|
|