[ 
https://issues.apache.org/jira/browse/AMQ-5865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14605561#comment-14605561
 ] 

ASF GitHub Bot commented on AMQ-5865:
-------------------------------------

GitHub user cshannon opened a pull request:

    https://github.com/apache/activemq/pull/124

    https://issues.apache.org/jira/browse/AMQ-5865

    StompSocket and MQTTSocket will now return the appropriate web socket
    remote address based on the HttpRequestServlet that initialized
    the web socket connection.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cshannon/activemq AMQ-5865

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq/pull/124.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #124
    
----
commit be10b866a7c530ab7efefef1dda82270506f25f7
Author: Christopher L. Shannon (cshannon) <[email protected]>
Date:   2015-06-29T12:35:17Z

    https://issues.apache.org/jira/browse/AMQ-5865
    
    StompSocket and MQTTSocket will now return the appropriate web socket
    remote address based on the HttpRequestServlet that initialized
    the web socket connection.

----


> Enable "getRemoteAddress()" method in WebSocket Requests
> --------------------------------------------------------
>
>                 Key: AMQ-5865
>                 URL: https://issues.apache.org/jira/browse/AMQ-5865
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: MQTT, stomp
>    Affects Versions: 5.11.0, 5.11.1
>         Environment: all
>            Reporter: Christian Kemper
>            Priority: Trivial
>              Labels: easyfix, easytest, features, javascript, patch
>             Fix For: 5.11.2, 5.12.0, 6.0.0
>
>         Attachments: CustomStompSocket.java, CustomWebSocketServlet.java
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The method (getRemoteAddress()) in class 
> "org.apache.activemq.transport.ws.AbstractStompSocket" does not return the 
> correct address; it returns always ""StompSocket_" + hashCode();" 
> We need the correct address (e.g. "wss://127.0.0.1:63114") for our use case. 
> The implementation whould be very simple. 
> In class "org.apache.activemq.transport.ws.jetty8.WSServlet" (and also in 
> jetty9 package) pass the address during creation of class StompSocket in the 
> same package: 
> String scheme = request.getScheme();
> if ("http".equalsIgnoreCase(scheme)) {
>       scheme = "ws";
> } else if ("https".equalsIgnoreCase(scheme)) {
>       scheme = "wss";
>               }
> WebSocket socket = new CustomStompSocket(scheme + "://" + 
> request.getRemoteAddr() + ":" + request.getRemotePort());
> It meight be that MQTT is also affected; a fix should be done by the same way.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to