Skip to content

simple implement of static web server (like nginx) with

Notifications You must be signed in to change notification settings

jarvanstack/go_static_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go_static_server

a simple demo of implements static web tcp proto

Proxy static request if you run it correctly.

CLONE

run this command to clone this repository.

git clone git@github.com:dengjiawen8955/go_static_server.git

CONFIG

you must config the bathPath in src/Main.java

// basePath is where your static files' folder. 
// you should change it in a property path.
basePath := "/root/go/src/go_static_server"

COMPILE AND RUN

cd go_satatic_server
# build
go build -o main main.go
# run
./main

output:

2021/06/07 21:53:39 listen=":9000"
# when there are some clients connect.
2021/06/07 21:53:45 NEW CLIENT:[::1]:57956
2021/06/07 21:53:52 NEW CLIENT:[::1]:57958

BROWSER TEST

if you run localhost and test also on localhost

# view a html
localhost:9000/index.html
# view a image.
localhost:9000/bmft.png

About

simple implement of static web server (like nginx) with

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published