0

I have a program using jpos, i want to filter so my server only respond from specific ip or port.

how to know where message come from ? This is my simple code

    public class ServerListener implements ISORequestListener {

    private final static Logger logger = LoggerFactory.getLogger(ServerListener.class);

    @Override
    public boolean process(ISOSource requester, ISOMsg reqMsg) {

    logger.debug("Heder Destinatnion " +reqMsg.getISOHeader().getDestination());

    logger.debug("Heder Source " +reqMsg.getISOHeader().getSource());
    return false
    }
    }

the log only show

Heder Destinatnion = null

Heder Source = null

user2571094
  • 177
  • 1
  • 3
  • 12

1 Answers1

1

If your ISOSource implementation is actually a channel that extends BaseChannel (most channel implementations extend BaseChannel), then you can cast your ISOSource to BaseChannel and get a reference to the underlying socket using BaseChannel.getSocket().

If you are using QServer you can configure the allowed hosts using the allow property.

And of course, you can use a firewall.

jrf
  • 490
  • 5
  • 16