File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/main/java/net/raphimc/viaproxy Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -137,9 +137,14 @@ public static void startProxy() {
137137 if (currentProxyServer != null ) {
138138 throw new IllegalStateException ("Proxy is already running" );
139139 }
140- currentProxyServer = new NetServer (Client2ProxyHandler ::new , Client2ProxyChannelInitializer ::new );
141- Logger .LOGGER .info ("Binding proxy server to " + Options .BIND_ADDRESS + ":" + Options .BIND_PORT );
142- currentProxyServer .bind (Options .BIND_ADDRESS , Options .BIND_PORT , false );
140+ try {
141+ currentProxyServer = new NetServer (Client2ProxyHandler ::new , Client2ProxyChannelInitializer ::new );
142+ Logger .LOGGER .info ("Binding proxy server to " + Options .BIND_ADDRESS + ":" + Options .BIND_PORT );
143+ currentProxyServer .bind (Options .BIND_ADDRESS , Options .BIND_PORT , false );
144+ } catch (Throwable e ) {
145+ currentProxyServer = null ;
146+ throw e ;
147+ }
143148 }
144149
145150 public static void stopProxy () {
You can’t perform that action at this time.
0 commit comments