Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Support Proxy environment #17

Open
prangenberg opened this issue Jan 9, 2018 · 1 comment
Open

Support Proxy environment #17

prangenberg opened this issue Jan 9, 2018 · 1 comment

Comments

@prangenberg
Copy link

It would be great if proxy settings could be provided to the appender.

e.g. an complete Proxy object which would be used in the openConnection method

@apandichi
Copy link

Not needed, you can setup the proxy connection details with something like this:

        Properties systemProperties = System.getProperties();
        systemProperties.setProperty("http.proxyHost",proxy);
        systemProperties.setProperty("http.proxyPort",port);
        systemProperties.setProperty("https.proxyHost",proxy);
        systemProperties.setProperty("https.proxyPort",port);
        System.setProperty("http.proxyUser", user);
        System.setProperty("http.proxyPassword", password);
        Authenticator.setDefault(
                new Authenticator() {
                    @Override
                    public PasswordAuthentication getPasswordAuthentication() {
                        return new PasswordAuthentication(
                                user, password.toCharArray());
                    }
                }
        );

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants