Java Http Tunneling - java

I'm currently trying to implement a Http Tunnel between a Java Client(That Includes Netty) to a server, so I would like to know if there's any server that is also based on Netty to support this Tunnel or should I build the server side my self?

I recently came upon this: http://www.jcraft.com/jhttptunnel/. Perhaps helps you...

Now netty includes an example of an HTTP Tunnel. The server must be aware (in some way) of it to work. The documentation of the API for HTTP tunneling (client and server) is available at org.jboss.netty.channel.socket.http

Related

HTTP Client-Server resquest response

I am trying to write a simple client-server application in Java using HTTP request/response. I would like the client to be a desktop program which sends (posts) a request to a server. The server is a web page which will be hosted on Apache Tomcat server. The server must be able to read the information and display it on the browser and must be able to respond to the client with a status code 200. I am using eclipse and Apache tomcat server. I have so far tried various resources, but all I could find is a client which could request response from an already existing web server. Could someone please give me an example or some insight on how to make the client request the our own server which runs on the local machine.
Good question, though in your case, I won't recommend you implement a simple HTTP request/response approach as you will end up implementing a timer, heartbeat or Comet. You might wanna try javax or jetty WebSocket API. All you need is to create three parts:
a websocket.server
a websocket.client (desktop application)
a javascript websocket client (browser agent)
Your server and both clients will become full-duplex via onMessage and send events.
Here's an example which I believe is a bit relevant one.
https://dzone.com/articles/sample-java-web-socket-client

cross language api for this client server communication model

my question is following up from this question:
Simple Protocol Concept in Java for this setup
The idea is exactly the same i.e client will send request and server respond with some information:
However i want a well known protocol implemtation such that the server/client can be implemented in any programming langguage. So that client Running java can communicate over TCP/IP sockets to remote app written in C e.g.
for this reason, can you recommend any well known opensource implementation?
Just few tips:
Rest interface: http://en.wikipedia.org/wiki/Representational_state_transfer
Corba: http://en.wikipedia.org/wiki/Common_Object_Request_Broker_Architecture
Apache Thrift: http://thrift.apache.org/
Google Protocol Buffers: https://developers.google.com/protocol-buffers/
your own implementation over tcp...
it depend on your architecture and your requirement, you can use TCP protocol directly, Http is another choice, if your server deployed on a http server, i recommend using web service. i hope my answer will give you some ideas.

Non-blocking SSL server using Thrift

Thrift provides several different non-blocking server models, like TNonblockingServer, THsHaServer, and TThreadedSelectorServer. But, I'd like to enable SSL on the server. It seems SSL only works on blocking servers in Thrift.
Anyone has any clues of a non-blocking SSL server in Thrift? Java example would be highly appreciated.
One alternative to worrying about SSL in your Java App is to stand up something like nginx (http://wiki.nginx.org/SSL-Offloader) as a reverse proxy.
This has the upside of your application not needing to care about SSL but does require one more layer in your stack.
Clients will connect to the nginx server instead of directly to your client and nginx will forward those connections to your Thrift server.
You don't necessarily need two different servers for this approach, just configure your Thrift server to only listen on localhost (127.0.0.1 for ipv4) and have nginx listen on your external interfaces and forward to localhost.
Edit: client -> server in last paragraph

How to invoke client method without using RMI

i am developing a client/server program in which i want to invoke a method of client program
through server program.
this is vnc based application in which the server will be running and listening to any arbitrary port number .... the client will connect to the server using a method which has argument in the form of ip and port number of server.
after that the server will be able to take control of the client's screen.
i want to call this method from server !!
i want to add a facility in which the client will submit a request and server will then connect to the client ..
i have heard about RMI but i want to know is there any other way available to achieve this if not pls post some good tutorial links on RMI .
RMI is a Java-only way for network programming or method calling but Web Service is language-independent. By web service you can integrate some application.
But my recommendation is using MOM systems. This type of system support two approach : Synchronous Model and 'Asynchronous Model'. In Java MOM is implemented via JMS.(look in here). JMS is an API and have several implementation such as :
Apache ActiveMQ
Open JMS Queue and etc
better than RMI, you could make a web service and a client for it :)
http://www.artima.com/lejava/articles/threeminutes.html

writing desktop application for connecting with server

I'm working on a server client base "Desktop Application". And what I want to do is this,
Client application sending some request code to server through internet(oh yes, these connections must be secured). and when server application gets this code it will again do some work and gather some data.
And then server application will return those data again to the client application.
As I am new in this, I need to know, what kind of tools to use?
Is eclipse good for that?
Where can I find good examples for writing client?
Where can I find examples for connecting client with server side?
I'd recomend checking out apache httpclient it really helps when dealing with web APIs.

Categories

Resources