73 Star 184 Fork 70

sanluan / ThinServer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

ThinServer

Public CMS

简介

ThinServer是基于JDK提供的HttpServer开发的Web服务容器和以socket开发的ftp server,体积小,主程序jar包只有43k。两种服务均可使用socket远程管理

提供windows,linux启动、停止脚本。

其中http server

Http应用开发简单只需要实现com.sanluan.server.application.ThinInitializer,com.sanluan.server.servlet.ThinServlet接口即可

默认的Servlet实现已经支持普通html文件等的http服务。所以这个容器也可以用来将某个目录发布为web站点。

代码中附带三个例子分别是ROOT(容器管理应用),demo1(FreeMarker实现动态示例),gpio4pi(通过遥控或网页控制4路开关示例)

gpio4pi的硬件设备与线路实现参考:http://www.publiccms.com/science/2015/11-05/193.html

执行bin/startHttp启动容器,执行bin/stopHttp停止程序。http服务默认端口:80;socket控制管理端口:8010,如果需要修改,请在脚本中添加参数

-Dcom.sanluan.server.ThinHttpServer.port=http端口

-Dcom.sanluan.server.ThinHttpServer.controlPort=http控制端口

conf/http.conf文件中可以配置默认加载的应用,grant 应用名 为授权该应用可以控制整个容器

其中ftp server

执行bin/startFtp启动容器,执行bin/stopFtp停止程序。ftp服务默认端口:21;socket控制管理端口:2121,如果需要修改,请在脚本中添加参数

-Dcom.sanluan.server.ThinFtpServer.port=ftp端口

-Dcom.sanluan.server.ThinFtpServer.controlPort=ftp控制端口

-Dcom.sanluan.server.ThinFtpServer.rootPath=ftp跟目录,默认为空

conf/ftp.conf文件中可以配置ftp用户格式为:用户@密码@路径 或 用户@路径(此时用户不需要密码即可访问) 或 用户(此时用户不需要密码,工作目录为环境中指定的目录)

欢迎一起学习和交流

授权

该软件永久开源免费(MIT 授权协议)

MIT License Copyright (c) 2020 sanluan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

快速搭建HTTP服务器,Ftp服务,仅43K大小,尤其适合树莓派、香蕉派等小型设备运行轻app或者进行简单文件共享使用。 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/sanluan/ThinServer.git
git@gitee.com:sanluan/ThinServer.git
sanluan
ThinServer
ThinServer
master

搜索帮助

14c37bed 8189591 565d56ea 8189591