evio/examples/README.md

38 lines
605 B
Markdown
Raw Normal View History

2017-10-28 03:01:03 +03:00
# `doppio 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).