Java SDK - addressed port?

Hi,

I’m currently doing some prototyping for a zitified java server application. On the server we are offering two separate ports. Let us use 80 and 443 on our sample.

I’ve created a sample setup, with the java netcat server sample. My service configurations are:

host:

{
  "address":"devel.test.local",
  "allowedPortRanges":[
    {
      "high":80,
      "low":80
    },
    {
      "high":443,
      "low":443
    }],
  "allowedSourceAddresses":[
  ],
  "forwardPort":true,
  "protocol":"tcp"
}

intercept:

{
  "addresses":[
    "devel.test.local"],
  "dialOptions":{
    "identity":""
  },
  "portRanges":[
    {
      "high":80,
      "low":80
    },
    {
      "high":443,
      "low":443
    }],
  "protocols":[
    "tcp"],
  "sourceIp":""
}

Connecting from my test-client with nc devel.test.local 80/443 from my client using Ziti Desktop Edge opens a connection and I cen transfer text messages. But how can I determine wich port was addressed on the server side to route it to the appropiate endpoint in my application?

Is my question related to the terminators from this sample?

Maybe I missed some doc - maybe I just need the right pointer.

Thanks & Bye,
Chris

Hi @marvkis, welcome to the community and thanks for the question. The Ziti Desktop Edge should send that information along to the far side in the appData field. You should be able to look in there for that information.

I went looking through the JVM sdk but didn’t see the appData was getting set in that SDK, so I probably missed it. @ekoby - can you comment on where that is or if we have an example that covers this?

I think you could always do this with two different services, each with the port you want, but I would think that if the appData were available you could just add your logic on the accept.

it is not available yet. I’ve created an issue for it make appData passed by the client accessible on the service side · Issue #415 · openziti/ziti-sdk-jvm · GitHub

Hi @TheLumberjack / @ekoby , thank you for your warm welcome and quick response. I’ve found some details about appData in a MD file - Yes, this thing would provide the port and maybe also some more details I would neet in a later stage. But for now I’m fine with using two separate services.

I’ll give it a try later this evening.

Thanks,
Chris