1

I have created a setup of Kaazing VPN on host machine and VM as guest machine taking reference from http://kaazingcorp.cachefly.net/com/file/kaazing-vpc.pdf URL & also, as suggested i have tested the connection using perl as well. But now i want to send the message to kaazing gateway on client side using some javascript and want to see that traveling to other side which has ActiveMQ configured. But, when i sent one message to some queue and created the producer. Than found that travel path is till Kaazing & MQ on client side. Can anybody tell me the solution.

Gateway details for client side.

<service>
    <name>proxy-connection</name>
    <accept>tcp://172.19.xx.xx:50505/</accept>
    <type>proxy</type>
    <properties>
        <connect>
            ws://192.168.yy.yy:8010/
        </connect>
    </properties>
</service>
<service-defaults>
<accept-options>
        <http.bind>8000</http.bind>
        <ws.bind>8010</ws.bind>
    </accept-options>
</service-defaults>

Gateway details for server side

<service>
    <name>proxy-connection</name>
    <accept>ws://192.168.yy.yy:8010/</accept>
    <type>proxy</type>
    <properties>
        <connect>
            tcp://10.a.b.c:50505/
        </connect>
    </properties>
</service>
<service-defaults>
<accept-options>
        <http.bind>8000</http.bind>
        <ws.bind>8010</ws.bind>
    </accept-options>  

And for sending message just created the small java script client connecting via JMS connection factory and creating a topic with producer and consumer before sending. But, not getting any message on other side but all messages are being displayed under MQ on client side. Please suggest.

StackUser
  • 141
  • 1
  • 1
  • 8

2 Answers2

0

10/8, 172.16/12 and 192.168/16 are all private ip address ranges. I am guessing you need external ip addresses for the messages to go to the other side.

If this is what it is supposed to look like:

client <--tcp--> gateway <---ws/internet---> gateway <--tcp--> server

Then tcp connection is local (private ip is fine) but ws connection needs to use a public ip.

This below is a private ip address:

ws://192.168.yy.yy:8010/

All connections will not leave your client. This cannot be your server's ip address... unless your server is also on the same local network.

Related comic: http://xkcd.com/742/

dnozay
  • 23,846
  • 6
  • 82
  • 104
  • thanks for your comment, actually i have created "gateway <---ws/internet---> gateway" part and tested with the perl script as provided in shared url using public ip but when connecting to "client <--tcp--> gateway" and sending message than i am not able to receive it on other end. – StackUser Nov 07 '14 at 07:54
  • it would be a good idea to check firewall rules and regular ssh connections from client to server. – dnozay Nov 07 '14 at 08:02
  • right the server is on same network as virtual machine...so i think connection should not be any problem but not sure about problem right now facing. – StackUser Nov 07 '14 at 08:43
0

if you just want to proxy any TCP traffic over a WebSocket, your gateway config looks to have a syntax error. for the client-side, your service definition should read:

<service>
  <name>proxy-connection</name>
  <accept>tcp://172.19.xx.xx:50505/</accept>
  <connect>ws://192.168.yy.yy:8010/proxy</connect>
  <type>proxy</type>
</service>

and the server gateway should read:

<service>
  <name>proxy-connection</name>
  <accept>ws://192.168.yy.yy:8010/proxy</accept>
  <connect>tcp://10.a.b.c:50505/</connect>
  <type>proxy</type>
</service>

but as others have said, the client-side gateway must be able to reach 192.168.yy.yy:8010. then, your client program would connect to a socket at 172.19.xx.xx:50505 and the TCP stream will be replayed at a server listening on 10.a.b.c:50505. i'm assuming you have an ActiveMQ broker listening for sockets on 10.a.b.c:50505 and have some ActiveMQ client connecting to a broker it thinks is running at 172.19.xx.xx:50505. as others have noted, you really want the client-side connect to refer to a publicly accessible IP or hostname and the accept URL on the server-side to match the connect address from the client.

what client side language are you using to connect to ActiveMQ over the Web? you might want to look at Kaazing's JMS edition which extends ActiveMQ (or any JMS broker) using JMS APIs directly into many clients (Java, JavaScript, .Net/Silverlight, Objective-C, Dalvik, Flash/Flex). this allows you use JMS APIs over the web directly in client programs without having a 2nd gateway running.

i work for Kaazing, so let me know if you need more help or any more questions answered.

Chache
  • 36
  • 1