2017-10-30 16:08:07 +03:00
|
|
|
# `evio examples`
|
2017-07-04 06:39:18 +03:00
|
|
|
|
2017-10-28 22:34:12 +03:00
|
|
|
## echo-server
|
2017-07-04 06:39:18 +03:00
|
|
|
|
2017-10-28 22:34:12 +03:00
|
|
|
Runs on port 5000
|
2017-10-28 03:01:03 +03:00
|
|
|
|
2017-07-04 06:39:18 +03:00
|
|
|
```
|
2017-10-28 22:34:12 +03:00
|
|
|
go run examples/echo-server/main.go
|
2017-07-04 06:39:18 +03:00
|
|
|
```
|
|
|
|
|
2017-10-28 22:34:12 +03:00
|
|
|
Connect with telnet and start entering text.
|
2017-07-04 06:39:18 +03:00
|
|
|
|
2017-10-28 22:34:12 +03:00
|
|
|
```
|
|
|
|
telnet localhost 5000
|
|
|
|
```
|
2017-07-04 06:39:18 +03:00
|
|
|
|
2017-10-28 22:34:12 +03:00
|
|
|
## http-server
|
2017-07-04 06:39:18 +03:00
|
|
|
|
2017-10-28 22:34:12 +03:00
|
|
|
Runs on port 8080
|
2017-10-28 03:01:03 +03:00
|
|
|
|
2017-07-04 06:39:18 +03:00
|
|
|
```
|
2017-10-28 22:34:12 +03:00
|
|
|
go run examples/http-server/main.go
|
|
|
|
```
|
|
|
|
|
2017-10-28 22:35:19 +03:00
|
|
|
Browse to http://localhost:8080.
|
2017-10-28 22:34:12 +03:00
|
|
|
All requests print `Hello World!`.
|
|
|
|
|
|
|
|
## redis-server
|
|
|
|
|
|
|
|
Runs on port 6380
|
|
|
|
|
|
|
|
```
|
|
|
|
go run examples/redis-server/main.go
|
|
|
|
```
|
|
|
|
|
|
|
|
- `GET`, `SET`, `DEL`, `FLUSHDB`, `QUIT`, `PING`, `ECHO`, `SHUTDOWN` commands.
|
|
|
|
- Compatible with the [redis-cli](https://redis.io/topics/rediscli) and [redis clients](https://redis.io/clients).
|