3

my question is quite simple. I would love to see my current Client / Server system running over HTTP/2.

Therefore i need to know if the clients are able to push messages to the Server. This in combination with KeepAlive would be a great benefit for my Application.

Regards!

ekul
  • 99
  • 1
  • 9
  • If I correctly understand what you need then all should works automatically. For example, the standard HTML page can have multiple ` – Oleg Apr 06 '16 at 15:12
  • Thank you for your answer. The Application shall not be used to provide HTML Data for Webbrowsers. I want to let a Server Client Connection run over HTTP/2 Protocoll to communicate and share data. Hope this makes sense to you – ekul Apr 07 '16 at 06:59
  • You are welcome! Which web server on which OS you use? In general you need use the latest version of the web server and dependent components like OpenSSL. You need to configure TLS very carefully and then *all relatively modern web browsers* will use HTTP/2 automatically. It's multiplexing feature of HTTP/2. The same requests from the client to the server will be send more quickly. I full agree with rkosegi: you use wrong terminology "Can a Client push messages to the server", because "push" will be used *only for sending the data from the server, which not requested by client explicitly*. – Oleg Apr 07 '16 at 07:08
  • Okay, my mistake. I want to use a Java based HTTP/2 Server. The architecture shall be the following. 1) The Server runs and waits. 2) A client connects (The HTTP/2 pipeline shall be open now) 3) The Client sents login credentials 4) After correct login the Server accept every incoming stream from the client. The Plan is to send messages over the pipeline from the client to the server. The Server should be able to handle this messages. – ekul Apr 07 '16 at 07:15
  • @MrNoSql : To me it sounds like you are going to misuse http/2 for something for what was not strictly designed for. Take a look at websocket, JMS (various transports) or MQTT.I think they fits better into semantics you just describe. – rkosegi Apr 07 '16 at 07:20
  • It sound good. Where you see any problem? What is your question? If you would use async requests to the server (it's the standard way since many years) then your client will automatically use the same one pipeline over HTTP/2 is both client and the server support HTTP/2. – Oleg Apr 07 '16 at 07:20
  • @Oleg sorry the answer was wrong :D I wanted to use the http/2 push because i thought it would be better performancing. So i thought if only the Server can push and the client only can set requests, the request won't get over the pipe. And so the performance benefit is blown away.. But if several request from one client would go over the pipe there would be any problem if i be able to implement http2 in java.. – ekul Apr 07 '16 at 07:34

1 Answers1

1

Push messages to server is equivalent to made regular request to server.

So yes, you can do this in http2 like in http.

rkosegi
  • 14,165
  • 5
  • 50
  • 83
  • Hi, thanks for the comment. And every Client-Push will go through the Pipeline? – ekul Apr 06 '16 at 13:37
  • Could you explain what you mean by 'client-push'? HTTP2 is using pipelining by design. – rkosegi Apr 06 '16 at 14:01
  • I mean that when i open a connection to a server as a client. The pipeline opens and could be configured to keep-alive. The question is can the client use the pipeline and transfer messages to the server that way. – ekul Apr 06 '16 at 14:30
  • Are you trying to mimic websocket? – rkosegi Apr 06 '16 at 14:43
  • Sorry for late reply. Yes, but over HTTP2 Protocol – ekul Apr 07 '16 at 06:49
  • You should rethink your design http://stackoverflow.com/questions/28582935/does-http-2-make-websockets-obsolete – rkosegi Apr 07 '16 at 07:00
  • Thank you. I've read it before ... So there is no known way to use websockets over http2 like described here? https://tools.ietf.org/html/draft-hirano-httpbis-websocket-over-http2-00 – ekul Apr 07 '16 at 07:08