Skip to content

Expose IP address for Acceptor #395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 5, 2020

Conversation

mirceapasoi
Copy link

As described in #388 I'd like to implement IP whitelisting functionality.

I've noticed that QuickFIX/J implements this functionality through the AllowedRemoteAddresses config ("List of remote IP addresses which are allowed to connect to this acceptor"):
https://www.quickfixj.org/usermanual/2.1.0/usage/configuration.html
While this is a good solution for static sessions, it doesn't work for my use-case because I'm using dynamic sessions.

The simplest solution I could think of was to add a RemoteAddr(sessionID) method on the Acceptor that can be used to get the address for a particular session.

@mirceapasoi mirceapasoi changed the title Expore IP address for Acceptor Expose IP address for Acceptor Jan 30, 2020
@mirceapasoi mirceapasoi requested a review from cbusbey January 30, 2020 17:30
@mirceapasoi
Copy link
Author

@cbusbey What do you think of this approach?

@@ -100,6 +101,11 @@ func (a *Acceptor) Stop() {
a.sessionGroup.Wait()
}

func (a *Acceptor) RemoteAddr(sessionID SessionID) (net.Addr, bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you are adding to the package api, could you add a comment here describing the method for api users that will be picked up by godoc?

Copy link
Author

Choose a reason for hiding this comment

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

Added comment

@mirceapasoi mirceapasoi requested a review from cbusbey February 5, 2020 18:30
@cbusbey cbusbey merged commit dd7be77 into quickfixgo:master Feb 5, 2020
level2player pushed a commit to longbridge/quickfix that referenced this pull request Jul 19, 2022
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.

None yet

2 participants