1 Star 1 Fork 0

kratos / netty-tools

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

netty-tools

A small collection of tools useful when working with JBoss Netty. The HTTP tools are useful for adding simple web features to your server.

Included

  • HTTP File Server
    A file serving handler based on Trustin Lee's example. Supports serving from file system or class path.
  • HTTP Cache
    A simple cache to be used in conjunction with the file server (see above). Will cache served files in-memory. Intended for caching smaller files.
  • HTTP Router
    Simple router that can route incoming HTTP requests to different ChannelHandlers. Supports very basic matching rules.
  • Bandwidth meter
    A monitor to measure the use of bandwidth in your Netty application. Place it first in your pipeline and it will measure the size of sent/received ChannelBuffers.
  • Async WebSocket client
    A WebSocket client in pure Java with Netty. Useful for integration testing. Being event-driven, it's also perfect for doing heavy load testing of WebSocket servers.
  • Thrift server support
    An RPC processor for Thrift is included together with a ChannelBuffer transport.
  • Thrift client support
    Transport for enabling Thrift clients to connect to remote Thrift servers through Netty. Thanks Davide Inglima!
  • Flash Policy file handling
    Can detect and respond to Adobe Flash Policy file requests. When not used, it can simply remove itself providing minimal performance hit.

Netty is not a web server and these tools are quite "raw" in the HTTP sense. If you intend to do anything moderately complex, please look elsewhere. I've used it for creating small HTTP-based admin interfaces for my Netty servers. That's one use case where these tools may come in handy.

This project is used in two applications the main author is working on. First one is Beaconpush, a real-time push server for browsers and mobile phones supporting a wide array of transports including Web Sockets. And the second one is Sonar Voice, which is an embeddable VoIP solution for the web/desktop/mobile with distributed voice servers.

Getting started

netty-tools is available on Maven Central. Just include the dependency in your POM file and you'll be up and running:

<dependency>
    <groupId>com.cgbystrom</groupId>
    <artifactId>netty-tools</artifactId>
    <version>1.2.7</version>
</dependency>

Examples

As of now, please see the tests for example usage.

Version history

  • 1.2.0 - Thrift HTTP support
  • 1.1.1 - Bug fixes
  • 1.1.0 - Thrift client and Flash Policy file handler
  • 1.0.2 - Async WebSocket client, Thrift support + various bug fixes
  • 1.0.1 - Internal version
  • 1.0.0 - Initial version

Authors

License

Open source licensed under the MIT license (see LICENSE file for details).

The MIT License Copyright (c) 2009 Carl Bystršm 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.

简介

A collection of tools useful when working with JBoss Netty. 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/kratos123/netty-tools.git
git@gitee.com:kratos123/netty-tools.git
kratos123
netty-tools
netty-tools
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891