On Wed, Jun 15, 2016 at 6:32 PM, Anant Sharma <[email protected]> wrote:
> Hi Team > > Greetings of the day. I would like to thank entire team for this wonderful > product. > > Hello, Anant. We're glad you like it! I am relatively new in the industry. I would like to write guacamole-client > application in node.js rather than in JAVA. So for this I seek your help > and support. How do I convert JAVA Servlet to node.js code. Please help. > Why do you want to do this? As you say you are relatively new in the industry, before I get into the "how", let me first advise that seeking to completely rewrite the low-level, performance-critical components of a well-established application for a completely different platform should not be your first choice when deciding on architecture. If firmly believe that you need to do this, take a step back and rethink things. If you are still positive that it needs to be done, stop and rethink things again. If you are STILL certain that the only way forward is to rewrite the Guacamole API in node, you need to reimplement the HTTP and WebSocket tunnels. Your application will need to handle the handshake portion of the Guacamole protocol on the server side. Once the handshake is complete, it is safe to allow data to be forwarded to guacd from the tunnel of choice. The HTTP tunnel is relatively complex, and involves splitting a single stream across multiple overlapping HTTP requests which must be handled in parallel. I'm not a node developer by any means, so I can't speak to whether node can do this. Assuming it can, this will be the hardest task. The WebSocket tunnel should be straightforward, but if all you have is WebSocket then you will lose some compatibility, and that's assuming this whole endeavor is sane to begin with. Overall, it is possible, but whether doing so would neuter performance is an open question. I strongly recommend that you use things as they are unless you truly have no other option. - Mike
