All Projects → JMagician → Magician

JMagician / Magician

Licence: MIT license
Magician is a small HTTP service package based on Netty that makes it very easy to start an http service, and also supports WebSocket, using annotated configuration Handler, If you want to develop an http service with netty but find it cumbersome, then Magician may help you.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Magician

T Io
解决其它网络框架没有解决的用户痛点,让天下没有难开发的网络程序
Stars: ✭ 1,331 (+1272.16%)
Mutual labels:  tcp, udp, nio
Mobileimsdk
一个原创移动端IM通信层框架,轻量级、高度提炼,历经8年、久经考验。可能是市面上唯一同时支持UDP+TCP+WebSocket三种协议的同类开源框架,支持iOS、Android、Java、H5,服务端基于Netty。
Stars: ✭ 3,864 (+3883.51%)
Mutual labels:  tcp, udp, nio
asyncio-socks-server
A SOCKS proxy server implemented with the powerful python cooperative concurrency framework asyncio.
Stars: ✭ 154 (+58.76%)
Mutual labels:  tcp, udp
socket
Dazzle Async Socket
Stars: ✭ 19 (-80.41%)
Mutual labels:  tcp, udp
twjitm-core
采用Netty信息加载实现长连接实时通讯系统,客户端可以值任何场景,支持实时http通讯、webSocket通讯、tcp协议通讯、和udp协议通讯、广播协议等 通过http协议,rpc协议。 采用自定义网络数据包结构, 实现自定义网络栈。
Stars: ✭ 98 (+1.03%)
Mutual labels:  tcp, udp
network
exomia/network is a wrapper library around System.Socket for easy and fast TCP/UDP client & server communication.
Stars: ✭ 18 (-81.44%)
Mutual labels:  tcp, udp
SACK
System Abstraction Component Kit
Stars: ✭ 18 (-81.44%)
Mutual labels:  tcp, udp
voice
Implementation of the Discord Voice API for discord.js and other JS/TS libraries
Stars: ✭ 310 (+219.59%)
Mutual labels:  tcp, udp
hev-socks5-tproxy
A simple, lightweight socks5 transparent proxy for Linux. (IPv4/IPv6/TCP/UDP over TCP)
Stars: ✭ 209 (+115.46%)
Mutual labels:  tcp, udp
nc
Porting Netcat in Node.js. CLI util. 💻
Stars: ✭ 17 (-82.47%)
Mutual labels:  tcp, udp
Rmessage
Reactive Programming Multi-protocol push service
Stars: ✭ 23 (-76.29%)
Mutual labels:  tcp, udp
UDPSender
UDPSender 一个基于NIO的UDP发送-接收器
Stars: ✭ 34 (-64.95%)
Mutual labels:  udp, nio
net-protocol
golang模拟内核协议栈 实现链路层、网络层、传输层、应用层 用户态协议栈 ,基于虚拟网卡TUN/TAP
Stars: ✭ 129 (+32.99%)
Mutual labels:  tcp, udp
reverse-tunnel
Reverse tunnel TCP and UDP
Stars: ✭ 100 (+3.09%)
Mutual labels:  tcp, udp
server-framework
纯C的分布式服务器框架通用模板,跨平台,模块动态加载,tcp/可靠UDP,协程RPC,日志,集群建立
Stars: ✭ 24 (-75.26%)
Mutual labels:  tcp, udp
Socket
The Hoa\Socket library.
Stars: ✭ 61 (-37.11%)
Mutual labels:  tcp, udp
ctsTraffic
ctsTraffic is a highly scalable client/server networking tool giving detailed performance and reliability analytics
Stars: ✭ 125 (+28.87%)
Mutual labels:  tcp, udp
Socketify
Raw TCP and UDP Sockets API on Desktop Browsers
Stars: ✭ 67 (-30.93%)
Mutual labels:  tcp, udp
node-drivers
Industrial protocol drivers in node.js
Stars: ✭ 20 (-79.38%)
Mutual labels:  tcp, udp
KingNetwork
KingNetwork is an open source library to facilitate the creation and communication of clients and servers via TCP, UDP, WebSocket and RUDP sockets.
Stars: ✭ 78 (-19.59%)
Mutual labels:  tcp, udp

Magician ·

Magician is a small HTTP service package based on Netty that makes it very easy to start an http service, and also supports WebSocket, using annotated configuration Handler.

If you want to develop an http service with netty but find it cumbersome, then Magician may help you.

Running environment

JDK11+


The Jar package for the maven central library supports at least JDK11, but the source code can support at least jdk8, if you need to run on 8, you can download the latest tag and compile it yourself

Documentation

https://magician-io.com

Example

Importing dependencies

<dependency>
    <groupId>com.github.yuyenews</groupId>
    <artifactId>Magician</artifactId>
    <version>2.0.2</version>
</dependency>

<!-- This is the logging package, you must have it or the console will not see anything, any logging package that can bridge with slf4j is supported -->
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-jdk14</artifactId>
    <version>1.7.12</version>
</dependency>

Creating an http service

Create a Handler

@HttpHandler(path="/")
public class DemoHandler implements HttpBaseHandler {

    @Override
    public void request(MagicianRequest magicianRequest, MagicianResponse response) {
        // response data
        magicianRequest.getResponse()
                .sendJson(200, "{'status':'ok'}");
    }
}

Start the http service

Magician.createHttp()
                    .scan("handler所在的包名")
                    .bind(8080);

Creating WebSocket

@WebSocketHandler(path = "/websocket")
public class DemoSocketHandler implements WebSocketBaseHandler {
   
    @Override
    public void onOpen(WebSocketSession webSocketSession) {
     
    }
   
    @Override
    public void onClose(WebSocketSession webSocketSession) {
        
    }

    @Override
    public void onMessage(String message, WebSocketSession webSocketSession) {

    }
}

More components

These components can be used to develop web projects easily

Magician-Web | Magician-JDBC

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].