JBoss Wildfly 17 server not accessible via the hosting laptop's IP address

16 Views Asked by At

I have Wildfly 17 server. It works fine from localhost, including Android Studio emulator, but I cannot connect via the hosting laptop's IP address, either on the laptop's HotSpot or using a router with port forwarding. Firewall is turned off. Router has port forwarding configured for the IP address (192.168.8.100).

Server Runtime configured to use standalone-full.xml:

<interfaces>
    <interface name="hotspot">
        <inet-address value="${jboss.bind.address:192.168.137.1}"/>
    </interface>
    <interface name="router">
        <inet-address value="${jboss.bind.address:192.168.8.100}"/>
    </interface>
    <interface name="management">
        <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
    </interface>
    <interface name="public">
        <inet-address value="${jboss.bind.address:192.168.8.100}"/>
    </interface>
    <interface name="unsecure">
        <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
    </interface>
</interfaces>
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
    <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
    <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
    <socket-binding name="http" port="${jboss.http.port:8080}"/> etc

Android App manifest.xml has INTERNET and PLAIN_TEXT enabled,

using OKHTTP in Android Studio:

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TextView textView = findViewById(R.id.response);

        findViewById(R.id.send).setOnClickListener(click -> {
            new Thread(() -> {
                Request request = new Request.Builder()
                        .url("http://192.168.8.100:8080/DynWebProj/AppLogin")
                        .build();

                OkHttpClient client = new OkHttpClient();

                client.newCall(request).enqueue(new Callback() {
                    @Override
                    public void onResponse(Call call, Response response) throws IOException {
                        if (response.isSuccessful()) {
                            final String responseData = response.body().string();
                            runOnUiThread(() -> textView.setText(responseData));
                        }
                    }

                    @Override
                    public void onFailure(Call call, IOException e) {
                        e.printStackTrace();
                    }
                });
            }).start();
        });
    }

What is the issue?

0

There are 0 best solutions below