mojira.dev
MC-38872

Minecraft ignores java proxy parameters

The bug

As of snapshot 13w41b, Minecraft ignores the following JVM proxy parameters:

-DsocksProxyHost=* -DsocksProxyPort=*

How to reproduce

I assume the server list is not empty and the port 5678 is not used

  1. Create a new profile

  2. Choose 1.6.4 version and add the following JVM arguments:

    -DsocksProxyHost=localhost -DsocksProxyPort=5678
  3. Play and look at the server list
    → ✔ There are communication errors (i.e. the proxy is used)

  4. Quit

  5. Edit the profile, choose the version 1.7.2 and save

  6. Play and look at the server list
    → ❌ No communication error (i.e. the proxy is not used)

Linked issues

Comments 28

It is not a duplicate since the arguments "-DsocksProxyHost=localhost -DsocksProxyPort=5678" work until 13w39b.

Moreover, it is not a launcher issue since minecraft (the game) is run with the correct arguments.
The only thing that change is the Minecraft version.
And, I can reproduce the issue without the launcher using either --proxyPort --proxyHost or -DsocksProxyPort/Host :

/usr/lib/jvm/java-7-openjdk/jre/bin/java -DsocksProxyHost=localhost -DsocksProxyPort=5678 -Xmx1G -Djava.library.path=/home/riri/.minecraft/versions/1.7.2/1.7.2-natives-3273057565428 -cp /home/riri/.minecraft/libraries/java3d/vecmath/1.3.1/vecmath-1.3.1.jar:/home/riri/.minecraft/libraries/net/sf/trove4j/trove4j/3.0.3/trove4j-3.0.3.jar:/home/riri/.minecraft/libraries/com/ibm/icu/icu4j-core-mojang/51.2/icu4j-core-mojang-51.2.jar:/home/riri/.minecraft/libraries/net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar:/home/riri/.minecraft/libraries/com/paulscode/codecjorbis/20101023/codecjorbis-20101023.jar:/home/riri/.minecraft/libraries/com/paulscode/codecwav/20101023/codecwav-20101023.jar:/home/riri/.minecraft/libraries/com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar:/home/riri/.minecraft/libraries/com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824.jar:/home/riri/.minecraft/libraries/com/paulscode/soundsystem/20120107/soundsystem-20120107.jar:/home/riri/.minecraft/libraries/io/netty/netty-all/4.0.10.Final/netty-all-4.0.10.Final.jar:/home/riri/.minecraft/libraries/com/google/guava/guava/15.0/guava-15.0.jar:/home/riri/.minecraft/libraries/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar:/home/riri/.minecraft/libraries/commons-io/commons-io/2.4/commons-io-2.4.jar:/home/riri/.minecraft/libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar:/home/riri/.minecraft/libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar:/home/riri/.minecraft/libraries/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar:/home/riri/.minecraft/libraries/com/mojang/authlib/1.3/authlib-1.3.jar:/home/riri/.minecraft/libraries/org/apache/logging/log4j/log4j-api/2.0-beta9/log4j-api-2.0-beta9.jar:/home/riri/.minecraft/libraries/org/apache/logging/log4j/log4j-core/2.0-beta9/log4j-core-2.0-beta9.jar:/home/riri/.minecraft/libraries/org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0.jar:/home/riri/.minecraft/libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0.jar:/home/riri/.minecraft/versions/1.7.2/1.7.2.jar net.minecraft.client.main.Main --username nheir --version 1.7.2 --gameDir /home/riri/.minecraft --assetsDir /home/riri/.minecraft/assets  --accessToken 1
/usr/lib/jvm/java-7-openjdk/jre/bin/java -Xmx1G -Djava.library.path=/home/riri/.minecraft/versions/1.7.2/1.7.2-natives-3273057565428 -cp /home/riri/.minecraft/libraries/java3d/vecmath/1.3.1/vecmath-1.3.1.jar:/home/riri/.minecraft/libraries/net/sf/trove4j/trove4j/3.0.3/trove4j-3.0.3.jar:/home/riri/.minecraft/libraries/com/ibm/icu/icu4j-core-mojang/51.2/icu4j-core-mojang-51.2.jar:/home/riri/.minecraft/libraries/net/sf/jopt-simple/jopt-simple/4.5/jopt-simple-4.5.jar:/home/riri/.minecraft/libraries/com/paulscode/codecjorbis/20101023/codecjorbis-20101023.jar:/home/riri/.minecraft/libraries/com/paulscode/codecwav/20101023/codecwav-20101023.jar:/home/riri/.minecraft/libraries/com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar:/home/riri/.minecraft/libraries/com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824.jar:/home/riri/.minecraft/libraries/com/paulscode/soundsystem/20120107/soundsystem-20120107.jar:/home/riri/.minecraft/libraries/io/netty/netty-all/4.0.10.Final/netty-all-4.0.10.Final.jar:/home/riri/.minecraft/libraries/com/google/guava/guava/15.0/guava-15.0.jar:/home/riri/.minecraft/libraries/org/apache/commons/commons-lang3/3.1/commons-lang3-3.1.jar:/home/riri/.minecraft/libraries/commons-io/commons-io/2.4/commons-io-2.4.jar:/home/riri/.minecraft/libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar:/home/riri/.minecraft/libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar:/home/riri/.minecraft/libraries/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar:/home/riri/.minecraft/libraries/com/mojang/authlib/1.3/authlib-1.3.jar:/home/riri/.minecraft/libraries/org/apache/logging/log4j/log4j-api/2.0-beta9/log4j-api-2.0-beta9.jar:/home/riri/.minecraft/libraries/org/apache/logging/log4j/log4j-core/2.0-beta9/log4j-core-2.0-beta9.jar:/home/riri/.minecraft/libraries/org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0.jar:/home/riri/.minecraft/libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0.jar:/home/riri/.minecraft/versions/1.7.2/1.7.2.jar net.minecraft.client.main.Main --username nheir --version 1.7.2 --gameDir /home/riri/.minecraft --assetsDir /home/riri/.minecraft/assets --accessToken 1  --proxyHost localhost --proxyPort 5678

Minecraft 1.7.2 does not take into account the proxy settings.
Plus 13w39b (and previous) uses -DsocksProxyHost/Port but ignores --proxyHost/Port.

Same Issue Win 8.1 x64. Minecraft 1.7.4. Java 7 u45 x64.
Socks proxy settings are simply ignored...

My connection slows down every connection out of port 80, 21, 22 etc etc.
So a minecraft server is pretty much unplayable (Ping is ~1000, data loss 60%) untill i use a proxy trough a ssh tunnel with my vps.

But if i shut down the proxy i can't even log in servers, i got auth failure error.

Oh, another Wyatt! 😃
...anyway, PLEASE CONFIRM this bug. I can no longer SSH tunnel my minecraft client. More specifically it works to connect to the server hosted on the network local to the host I SSH into, but not any on external networks.
also, I have this problem with multiple OSes: I have tried this in Linux Mint 14 (based on Ubuntu 12.04) with 64-bit java 7, Mac OSX Snow Leopard (10.6.8) with both OpenJDK 7 and Apple's Java 6, in both 32-bit and 64-bit modes, Windows 8.0 32-bit, Windows 7 64-bit, Ubuntu 13.04 64-bit, and Linux Mint 16 64-bit (based on Ubuntu 13.04).

PLEASE, confirm this bug. I attempted the same thing with a 1.6.4 server last week, with multiple OSes, and all worked perfectly. 1.7 has broken this.

edit I have tried both a normal proxy and SSH tunnels. These are both broken. Please fix this!!!

To follow up, here's the arguments I used and the errors displayed:

-Xmx1G -DsocksProxyHost=127.0.0.1 -DsocksProxyPort=8080 -DhttpProxyHost=127.0.0.1 -DhttpProxyPort=8080 -DhttpsProxyHost=127.0.0.1 -DhttpsProxyPort=8080

log:

[11:26:03 INFO]: Client> [11:26:03] [Server Connector #1/ERROR]: Couldn't connect to server
[11:26:03 INFO]: Client> java.net.ConnectException: Connection timed out: no further information: p.nerd.nu/198.24.131.140:25565
[11:26:03 INFO]: Client> at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:1.7.0_45]
[11:26:03 INFO]: Client> at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source) ~[?:1.7.0_45]
[11:26:03 INFO]: Client> at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:191) ~[NioSocketChannel.class:?]
[11:26:03 INFO]: Client> at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:228) ~[AbstractNioChannel$AbstractNioUnsafe.class:?]
[11:26:03 INFO]: Client> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:497) ~[NioEventLoop.class:?]
[11:26:03 INFO]: Client> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447) ~[NioEventLoop.class:?]
[11:26:03 INFO]: Client> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341) ~[NioEventLoop.class:?]
[11:26:03 INFO]: Client> at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) ~[SingleThreadEventExecutor$2.class:?]
[11:26:03 INFO]: Client> at java.lang.Thread.run(Unknown Source) ~[?:1.7.0_45]

18 more comments

I can't believe on this day they haven't added a way to play through a proxy in an easy and reliable way. I work on weekends and I usually don't have anything to do and all I want to do is play a bit of minecraft but I can't because I have to connect with a proxy.

Affects 1.11.2 & 17w06a.
Linux Mint 17 x64.

Hm, this issue is odd; MC itself actually supports a proxy argument (check net.minecraft.client.main.Main; there are --proxyHost, --proxyPort, --proxyUser, and --proxyPass arguments) but the launcher doesn't use them. The code that handles those options is probably what disables the normal method of specifying a proxy. But that these are inaccessible is weird... (Note: you can specify JVM arguments in the launcher, but not arguments to be passed to the game; those are set in the version JSON).

I try to connect the a minecraft server 1.16.2 to a proxy using following java arguments -DsocksProxyHost=proixy.domain.lan -DsocksProxyPort=3128
on the proxy server the log file say : "error:transction-end-before-headers"
but it completely ignore the following java arguments :
-Djava.net.useSystemProxyes=true
-Dhttp.proxyHost= proixy.domain.lan
-Dhttp.proxyPort=3128
-Dhttps.proxyHost= proixy.domain.lan
-Dhttps.proxyPort=3128

it would be nice to have option in there server properties or as command option to set up set proxy

Henri D

(Unassigned)

Confirmed

Platform

Low

Networking

multiplayer, proxy, socks

Minecraft 1.7.2, Minecraft 14w11b, Minecraft 1.8.1-pre3, Minecraft 1.8.7, Minecraft 1.8.9, ..., Minecraft 1.13.2, Minecraft 19w08b, 1.16.5, 21w08b, 1.21

Retrieved