# nafos
**Repository Path**: vzhougm/nafos
## Basic Information
- **Project Name**: nafos
- **Description**: 基于Netty的Http/socket高性能轻度应用框架,支持Json,Protobuffer,无缝兼容spring,绝对是微服务的不错选择。
- **Primary Language**: Java
- **License**: GPL-3.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 31
- **Created**: 2019-07-16
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
NAFOS
never ask for our savior,he's busier than you.
## 简介
nafos是一个基于netty的轻量级高性能服务端应用框架,能同时支持http,tcp,websocket通信,Json和Protobuffer编码协议以及压缩和加密。
最重要的是,它使用非常简单,且非常轻,启动速度快,是微服务的不二选择。
## 文档
- [文档-请点击此处](https://www.showdoc.cc/nafos2?page_id=1918717850709847)
## 特点
- 1、简单易用:通过简单的配置文件即可建立完善的启动方案,然后就可以开心的关注业务代码了;
- 2、强兼容: 可单机同时支持HTTP,TCP,websocket等服务,小规模应用下不用多开占用资源;
- 3、高性能:网络抽象框架采用的netty,性能无忧;
- 4、易扩展:无缝添加springboot,可完美支持spring大家族系列;
- 5、自带分布式限流器,多策略轻松抵御流量攻击;
- 6、房间策略:封装常见游戏的房间策略,开房,比赛,聊天可直接调用,无需多写;
- 7、双编码:同时支持json和protobuffer格式编码,手游网站一块搞定;
- 8、饿处理:设置了二级线程池处理请求,在阻塞下最大限度的接受请求防止丢失;
- 9、自单点:一键配置即可实现SSO单点登录,简单方便又实用;
- 10、安全节流:简单开启数据压缩和加密,节约带宽又安全;
## 交流
- 邮箱:805748009@qq.com
## 快速接口
```java
@ComponentScan({"com","nafos"})
@Controller
public class Run {
public static void main(String[] args) {
new NafosServer(Run.class)
.registDefaultProtocol(Protocol.JSON)
.startupHttp(8050);
}
@Get(uri="/hello")
public Object hello(NsRequest nsRequest){
System.out.println(nsRequest.intQueryParam("count"));
return null;
}
}
```
## 参与
Contributions are welcome! Open a pull request to fix a bug, or open an [Issue](https://gitee.com/huangxinyu/BC-NETTYGO/issues) to discuss a new feature or change.
欢迎参与项目贡献!比如提交PR修复一个bug,或者新建 [Issue](https://gitee.com/huangxinyu/BC-NETTYGO/issues) 讨论新特性或者变更。
## Copyright and License
This product is open source and free, and will continue to provide free community technical support. Individual or enterprise users are free to access and use.
- Licensed under the GNU General Public License (GPL) v3.
- Copyright (c) 2015-present, xuxueli.
产品开源免费,并且将持续提供免费的社区技术支持。个人或企业内部可自由的接入和使用。