GithubHelp home page GithubHelp logo

sanluan / thinserver Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 4.0 3.04 MB

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

License: MIT License

Shell 0.32% Batchfile 0.28% Java 33.92% HTML 2.26% CSS 7.46% JavaScript 55.77%

thinserver's Introduction

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 授权协议)

thinserver's People

Contributors

sanluan avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.