From: Martin F. <mar...@po...> - 2020-09-28 11:44:07
|
On 25/09/2020 12:32, david.mblackburn--- via Hl7api-devel wrote: > > Hi All, > > > > I have been using HL7 HAPI for a while now but have been recently > asked if we could restrict the server listener so that only designated > ip addresses can connect, when invoking the server there doesn’t > appear to be a way to do this unless I use an external firewall on the > server machine, any thoughts? > I solved it by extending SimpleServer: public class MyService extends SimpleServer @Override public synchronized void newConnection(ActiveConnection c) { String sourceAddress = c.getRemoteAddress().getHostAddress(); .... check sourceAddress } --- MyService service = new MyService(this.clientContext, port, false); service.registerApplication(..) service.start(); Wbr Martin |