Search code examples
jxbrowser

Jxbrowser 6.2 proxy authentication


The dialog that displays when using this code does not have a username and password textboxes. Is this a bug or am I doing something wrong?

browser.getContext().getNetworkService().setNetworkDelegate(new DefaultNetworkDelegate() {
        @Override
        public boolean onAuthRequired(AuthRequiredParams params) {
            if (params.isProxy()) {
                params.setUsername("proxy-username");
                params.setPassword("proxy-password");
                return false;
            }
            return true;
        }
    });

Solution

  • This code doesn't display a dialog. This code just sets username and password values and return. If you need to display login dialog, then you don't need to register NetworkDelegate.