A Java HTTP Server

后端 未结 10 1934
轮回少年
轮回少年 2021-01-03 08:59

I want to implement a Java HTTP server locally, I mean the server computer would be in my control. I\'m expecting not more than 20 clients to send requests to it. I was wond

相关标签:
10条回答
  • 2021-01-03 09:09

    I guess the biggest question is: why do you want to build this?

    If it is for the purpose of personal development, I'd stick to whatever standard libraries come with your JDK and build it on top of that.

    If on the other hand you have a particular application that needs a dedicated HTTP server I would try to take one of the open source servlet containers, like Jetty or Tomcat and build on those.

    0 讨论(0)
  • 2021-01-03 09:13

    Ad your 3) option: Try JBoss Netty.

    http://fisheye.jboss.org/browse/Netty/trunk/src/main/java/org/jboss/netty/example/http/websocket

    0 讨论(0)
  • 2021-01-03 09:22

    Do you really want to build a HTTP server that deals with the protocol directly, or do you just want to write web apps? If all you care about is writing the web apps, then just use Tomcat, or Jetty, or Glassfish, or another server -- it will save you a ton of work.

    If you really are interested in writing your own server from scratch, then the best way would be to just use Java SE, and not use any existing server technology.

    0 讨论(0)
  • 2021-01-03 09:24

    Embed Jetty in your application. Aside from performing quite well, it is delightfully easy to use and configure

    0 讨论(0)
提交回复
热议问题