Skip to content

Add "Override local binding" to HTTP Sender#333

Open
jbeckers wants to merge 3 commits into
OpenIntegrationEngine:mainfrom
jbeckers:feature/332-add-override-local-binding-to-http-sender
Open

Add "Override local binding" to HTTP Sender#333
jbeckers wants to merge 3 commits into
OpenIntegrationEngine:mainfrom
jbeckers:feature/332-add-override-local-binding-to-http-sender

Conversation

@jbeckers

Copy link
Copy Markdown

Fixes #332

@jbeckers

Copy link
Copy Markdown
Author

No AI was used in the making of this PR, only good ol' manual copy-paste.

@jbeckers

Copy link
Copy Markdown
Author

I tested this in a podman container with 2 bridged networks.

Results of "Test connection":

  • without override
no-override
  • with empty override
override-empty
  • with IP 10.88.0.6 override
override-88
  • with IP 10.89.0.3 override
override-89

@jbeckers

Copy link
Copy Markdown
Author

Sending a message IP 10.89.0.3 override
message

@jbeckers

Copy link
Copy Markdown
Author

This PR probably needs some unit tests. I'll work on that at the end of this week.

@jbeckers jbeckers force-pushed the feature/332-add-override-local-binding-to-http-sender branch from fba0393 to 4221c0a Compare June 30, 2026 19:25
@mgaffigan mgaffigan requested a review from Copilot June 30, 2026 19:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an “Override Local Binding” option to the HTTP Sender so outbound HTTP connections (and the “Test Connection” action) can bind to a specific local source IP, aligning HTTP Sender capabilities with other connectors.

Changes:

  • Added overrideLocalBinding + localAddress properties to HTTP dispatcher settings and wired them through the client UI.
  • Applied Apache HTTP Client RequestConfig.Builder#setLocalAddress(...) when override is enabled.
  • Extended connection testing to optionally bind a local address during socket connection tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
server/src/com/mirth/connect/server/util/ConnectorUtil.java Adds an overload to allow connection tests to bind to a local address.
server/src/com/mirth/connect/connectors/http/HttpDispatcherProperties.java Introduces new HTTP sender properties for overriding local binding and storing a local address.
server/src/com/mirth/connect/connectors/http/HttpDispatcher.java Configures Apache HTTP client requests to bind to the configured local address when enabled.
server/src/com/mirth/connect/connectors/http/HttpConnectorServlet.java Updates “Test Connection” to optionally bind the local address when override is enabled.
client/src/com/mirth/connect/connectors/http/HttpSender.java Adds UI controls for “Override Local Binding” and “Local Address”, plus validation/reset behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/src/com/mirth/connect/connectors/http/HttpDispatcher.java
Comment thread server/src/com/mirth/connect/connectors/http/HttpDispatcher.java
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Joachim Beckers <joachim@jbeckers.be>

@mgaffigan mgaffigan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice feature! I think some additional work is required to correct the velocity issue, and to fix the DCO check, but after that it looks good to me.

Thanks for sharing!

@github-actions

Copy link
Copy Markdown

Test Results

  111 files    214 suites   5m 45s ⏱️
  651 tests   651 ✅ 0 💤 0 ❌
1 302 runs  1 302 ✅ 0 💤 0 ❌

Results for commit 82c7915.

@mgaffigan mgaffigan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbeckers - looks all good. Can you fix the DCO? Need that before we can approve.

@kpalang kpalang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes/clarifications required.

Review comments formatted as conventional comments

Comment on lines 1 to 8
/*
* Copyright (c) Mirth Corporation. All rights reserved.
*
*
* http://www.mirthcorp.com
*
*
* The software in this package is published under the terms of the MPL license a copy of which has
* been included with this distribution in the LICENSE.txt file.
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: While you're here I'd love to see the copyright notice be re-formatted in SPDX format. An example can be found here.

}

if (props.isOverrideLocalBinding()) {
if (props.getLocalAddress().length() <= 3) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Why is 3 significant?

Comment on lines +1556 to +1564
private void overrideLocalBindingYesRadioActionPerformed(ActionEvent evt) {
localAddressField.setEnabled(true);
localAddressLabel.setEnabled(true);
}

private void overrideLocalBindingNoRadioActionPerformed(ActionEvent evt) {
localAddressField.setEnabled(false);
localAddressLabel.setEnabled(false);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: No need to carry the ActionEvent as an argument if it is not used.

Comment on lines 1 to 8
/*
* Copyright (c) Mirth Corporation. All rights reserved.
*
*
* http://www.mirthcorp.com
*
*
* The software in this package is published under the terms of the MPL license a copy of which has
* been included with this distribution in the LICENSE.txt file.
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: While you're here I'd love to see the copyright notice be re-formatted in SPDX format. An example can be found here.

final int port;
if (url.getPort() != -1) {
port = url.getPort();
} else if (Strings.CI.equals(url.getProtocol(), "https")) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: Tbh I'm not a fan of a library call for such simple comparison. I might be leaning towards "https".equalsIgnoreCase(url.getProtocol()).

Comment on lines +318 to +321
final RequestConfig.Builder requestConfigBuilder = RequestConfig.custom()
.setConnectTimeout(socketTimeout)
.setSocketTimeout(socketTimeout)
.setStaleConnectionCheckEnabled(true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Love the improved readability by splitting each builder function to a new line.

Comment on lines 1 to 8
/*
* Copyright (c) Mirth Corporation. All rights reserved.
*
*
* http://www.mirthcorp.com
*
*
* The software in this package is published under the terms of the MPL license a copy of which has
* been included with this distribution in the LICENSE.txt file.
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: While you're here I'd love to see the copyright notice be re-formatted in SPDX format. An example can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IDEA] Add 'Override local binding' to HTTP Sender

4 participants