You've already forked qlg.tsgz.moe
addons
app_download_files
extend
hyhproject
mobile
oss
static
thinkphp
upload
vendor
5ini99
composer
oss-sdk
swoole
.github
benchmark
ab.sh
async.php
coroutine.php
eof_server.php
http.go
http.js
http.php
http2.go
length_server.php
post.big.data
post.data
redis.go
run.php
seria_bench.php
table.php
tcp.go
tcp.js
tcp.php
timer.php
udp.php
websocket.php
examples
include
src
tests
thirdparty
tools
travis
.gitignore
.gitmodules
.travis.yml
CMakeLists.txt
CREDITS
LICENSE
README.md
Version2.md
build.sh
clear.sh
config.m4
make.sh
package.xml
php7_wrapper.h
php_swoole.h
swoole.c
swoole_async.c
swoole_atomic.c
swoole_buffer.c
swoole_channel.c
swoole_channel_coro.cc
swoole_client.c
swoole_client_coro.c
swoole_config.h
swoole_coroutine.cc
swoole_coroutine.h
swoole_coroutine_util.c
swoole_event.c
swoole_http.h
swoole_http_client.c
swoole_http_client.h
swoole_http_client_coro.c
swoole_http_server.c
swoole_http_v2_client.c
swoole_http_v2_client.h
swoole_http_v2_client_coro.c
swoole_http_v2_server.c
swoole_lock.c
swoole_memory_pool.c
swoole_mmap.c
swoole_msgqueue.c
swoole_mysql.c
swoole_mysql.h
swoole_mysql_coro.c
swoole_postgresql_coro.c
swoole_postgresql_coro.h
swoole_process.c
swoole_process_pool.c
swoole_redis.c
swoole_redis_coro.c
swoole_redis_server.c
swoole_ringqueue.c
swoole_runtime.cc
swoole_serialize.c
swoole_serialize.h
swoole_server.c
swoole_server_port.c
swoole_socket_coro.c
swoole_table.c
swoole_timer.c
swoole_trace.c
swoole_websocket_server.c
wechat
.htaccess
autoload.php
wxtmp
.gitignore
.htaccess
.user.ini
404.html
H5B854518.wgt
admin.php
app-release.apk
app_download.html
cash.lock
demo.php
get_startup.php
get_version.php
get_version_new.php
index.html
index.php
reg.lock
robots.txt
28 lines
753 B
Go
Executable File
28 lines
753 B
Go
Executable File
package main
|
|
|
|
import (
|
|
"log"
|
|
"github.com/valyala/fasthttp"
|
|
"runtime"
|
|
"fmt"
|
|
)
|
|
|
|
func main() {
|
|
runtime.GOMAXPROCS(runtime.NumCPU() - 1)
|
|
|
|
m := func(ctx *fasthttp.RequestCtx) {
|
|
switch string(ctx.Path()) {
|
|
case "/":
|
|
ctx.Response.Header.Set("Last-Modified", "Thu, 18 Jun 2015 10:24:27 GMT")
|
|
ctx.Response.Header.Set("Accept-Ranges", "bytes")
|
|
ctx.Response.Header.Set("E-Tag", "55829c5b-17")
|
|
ctx.Response.Header.Set("Server", "golang-http-server")
|
|
fmt.Fprint(ctx, "<h1>\nHello world!\n</h1>\n")
|
|
default:
|
|
}
|
|
}
|
|
|
|
log.Printf("Go fatshttp Server listen on :8888")
|
|
log.Fatal(fasthttp.ListenAndServe(":8888", m))
|
|
}
|