[undertow-dev] How to get the remote socket address of a javax.websocket.Session ?

Stuart Douglas sdouglas at redhat.com
Sat Jan 16 02:31:55 EST 2016


You would need to cast it to io.undertow.websockets.jsr.UndertowSession and then get getWebSocketChannel(). You can then get this via getSourceAddress().

Stuart

----- Original Message -----
> From: "Salvadè Angelo" <Angelo.Salvade at zkb.ch>
> To: undertow-dev at lists.jboss.org
> Sent: Friday, 15 January, 2016 8:19:11 PM
> Subject: [undertow-dev] How to get the remote socket address of a	javax.websocket.Session ?
> 
> Hi all
> 
> I'd like to get the remote socket address (the address of the client of the
> session) of a javax.websocket.Session.
> There seems to be no official way in the Java WebSocket API for this.
> 
> Is there a solution for this with Undertow ?
> 
> BTW, Jetty adds it to javax.websocket.Session.getUserProperties() with the
> key
> org.eclipse.jetty.websocket.jsr356.server.JsrCreator.PROP_REMOTE_ADDRESS.
> 
> Regards,
> Angelo
> 
> 
> ________________________________
> 
> Disclaimer:
> 
> 
> Aufgrund der bisherigen E-Mail-Korrespondenz bzw. der getroffenen Absprache,
> betrachtet sich die Zürcher Kantonalbank als berechtigt, mit Ihnen per
> E-Mail zu kommunizieren. Die Zürcher Kantonalbank geht davon aus, dass Sie
> die Risiken von E-Mails kennen und in Kauf nehmen (insbesondere fehlende
> Vertraulichkeit, Manipulation oder Missbrauch durch Dritte, Fehlleitung,
> verzögerte Übermittlung oder Bearbeitung, Viren, etc.). Die Zürcher
> Kantonalbank lehnt jede Haftung für Schäden im Zusammenhang mit der
> Verwendung von E-Mails ab, sofern die Bank die geschäftsübliche Sorgfalt
> nicht verletzt hat.
> 
> E-Mails werden nur während den üblichen Geschäftszeiten der Bank bearbeitet.
> Sie können nicht von der sofortigen Kenntnisnahme Ihrer E-Mails ausgehen.
> E-Mail eignet sich daher nicht für die Übermittlung von Handelsaufträgen und
> wertverschiebenden oder zeitkritischen Aufträgen (z.B. Zahlungsaufträge).
> 
> Sollten Sie dieses E-Mail irrtümlicherweise erhalten haben, bitten wir Sie,
> das E-Mail an die Zürcher Kantonalbank zurückzusenden und das E-Mail
> anschliessend mitsamt allen Anhängen von ihrem System zu löschen. Der
> Gebrauch der im E-Mail enthaltenen Information ist verboten.
> 
> 
> Based on previous e-mail correspondence or an arrangement we have reached
> with you, Zürcher Kantonalbank considers itself to be entitled to
> communicate with you via e-mail. Zürcher Kantonalbank assumes that you know
> the risks associated with e-mails and that you accept them (in particular,
> the lack of confidentiality, manipulation or misuse by third parties,
> misdirection, delayed transmission or processing, viruses, etc.). Zürcher
> Kantonalbank accepts no liability whatsoever for damage caused in connection
> with the use of e-mail, provided that the Bank has not failed to exercise
> customary due care.
> 
> E-mails are processed only during the Bank’s normal business hours. You
> cannot assume that your e-mails will be read immediately. E-mails are
> therefore not suitable for sending trading orders and orders that change the
> value of an account or are time-critical (e.g. payment orders).
> 
> If you have received this e-mail in error, please respond to Zürcher
> Kantonalbank and then delete this e-mail and your response together with all
> attachments from your system. The use of the information contained in the
> e-mail is prohibited.
> 
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev



More information about the undertow-dev mailing list