Skip to content

Commit 87bdf93

Browse files
author
ShengTao
committed
feat(*): modify
1 parent b7e7ce0 commit 87bdf93

11 files changed

+78
-24
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.idea
22
.vscode
3-
playproxy
43
bin
4+
shadowproxy

Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
FROM golang:1.16 AS build
22
WORKDIR /playproxy
33
ADD . .
4-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/playproxy .
4+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/shadowproxy .
55

66
FROM nginx:stable-alpine
77

88
WORKDIR /root
99

10-
COPY --from=build /playproxy/bin/playproxy /root/playproxy
11-
COPY --from=build /playproxy/docker/config.yaml /root/config/config.yaml
10+
COPY --from=build /shadowproxy/bin/shadowproxy /root/shadowproxy
11+
COPY --from=build /shadowproxy/docker/config.yaml /root/config/config.yaml
1212

13-
CMD nginx && /root/playproxy -c /root/config/config.yaml
13+
CMD nginx && /root/shadowproxy -c /root/config/config.yaml

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
PROG=bin/playproxy
1+
PROG=bin/shadowproxy
22

33

44
SRCS=.
55

66
# 安装目录
7-
INSTALL_PREFIX=/usr/local/playproxy
7+
INSTALL_PREFIX=/usr/local/shadowproxy
88

99
# 配置安装的目录
10-
CONF_INSTALL_PREFIX=/usr/local/playproxy
10+
CONF_INSTALL_PREFIX=/usr/local/shadowproxy
1111

1212
# git commit hash
1313
COMMIT_HASH=$(shell git rev-parse --short HEAD || echo "GitNotFound")
@@ -29,7 +29,7 @@ all:
2929
RELEASE_DATE = $(shell date '+%Y%m%d%H%M%S')
3030
RELEASE_VERSION = $(shell git rev-parse --short HEAD || echo "GitNotFound")
3131
RELEASE_DIR=release_bin
32-
RELEASE_BIN_NAME=playproxy
32+
RELEASE_BIN_NAME=shadowproxy
3333
release:
3434
if [ ! -d "./$(RELEASE_DIR)/$(RELEASE_DATE)_$(RELEASE_VERSION)" ]; then \
3535
mkdir ./$(RELEASE_DIR)/$(RELEASE_DATE)_$(RELEASE_VERSION); \
@@ -48,6 +48,6 @@ install:
4848
clean:
4949
rm -rf ./bin
5050

51-
rm -rf $(INSTALL_PREFIX)/bin/playproxy
51+
rm -rf $(INSTALL_PREFIX)/bin/shadowproxy
5252

5353
rm -rf $(CONF_INSTALL_PREFIX)

README.md

+58-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,61 @@
1-
## PlayProxy
1+
![logo](logo.png)
22

3-
playproxy is a proxy based on native https protocal. But can response a http2 website that you configured without authorization. You just need go to probe-resist-domain once with one browse that support proxy plug-in.
3+
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![GoDoc](https://godoc.org/github.com/cloudflare/cfssl?status.svg)](https://pkg.go.dev/github.com/nisainan/shadowproxy)
44

5-
Another benefit is that you don't need to start one more client.Go browse all the things!
5+
A proxy based on native https protocal. But can response a http2 website that you configured without authorization to hide your proxy.
66

7-
Thanks [forwardproxy](https://github.com/caddyserver/forwardproxy.git)
7+
## Features
8+
9+
- Native proxy
10+
- TLS support
11+
- Authorization
12+
- Camouflage traffic
13+
14+
## Installing
15+
16+
~~~shell
17+
$ git clone https://github.com/nisainan/shadowproxy.git
18+
$ cd shadowproxy
19+
$ make
20+
~~~
21+
22+
You can set GOOS and GOARCH environment variables to allow Go to cross-compile alternative platforms.
23+
24+
The resulting binaries will be in the bin folder:
25+
26+
~~~shell
27+
$ tree bin
28+
bin
29+
├── shadowproxy
30+
~~~
31+
32+
Edit `config.yaml` with your own data
33+
34+
~~~yaml
35+
listen-address: "0.0.0.0:443" # listen address
36+
username: "username" # authorization username
37+
password: "password" # authorization password
38+
probe-resist-domain: "shengtao.link" # authentication url
39+
cert-file: "xxxx" # cert file localtion
40+
key-file: "xxxx" # key file localtion
41+
cheat-host: "127.0.0.1:80" # cheat-host, make sure this server works
42+
~~~
43+
44+
~~~shell
45+
$ shadowproxy -c config.yaml
46+
~~~
47+
48+
## Usage
49+
50+
1. Use [SwitchyOmega](chrome-extension://padekgcemlokbadohgkifijomclgjgif/options.html#!/about) in your browser
51+
2. Add a https proxy.Don't forget filling in username and passowrd
52+
3. Access `probe-resist-domain` in your browser
53+
4. Congratulations,Go browse all the things!
54+
55+
## License
56+
57+
ShadowProxy source code is available under the MIT [License](https://github.com/nisainan/shadowproxy/blob/master/LICENSE).
58+
59+
## Thanks
60+
61+
[forwardproxy](https://github.com/caddyserver/forwardproxy.git)

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module playproxy
1+
module github.com/nisainan/shadowproxy
22

33
go 1.16
44

logo.png

13.9 KB
Loading

main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
package main
22

33
import (
4+
"github.com/nisainan/shadowproxy/confer"
5+
"github.com/nisainan/shadowproxy/server"
46
"github.com/urfave/cli"
57
"log"
68
"os"
79
"os/signal"
8-
"playproxy/confer"
9-
"playproxy/server"
1010
)
1111

1212
func main() {
1313
log.SetFlags(log.Lshortfile | log.LstdFlags)
1414
app := cli.NewApp()
15-
app.Name = "playproxy"
15+
app.Name = "github.com/nisainan/shadowproxy"
1616
app.Flags = []cli.Flag{
1717
cli.StringFlag{
1818
Name: "c",

server/handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (s *Server) onAccept(ctx context.Context, res http.ResponseWriter, req *htt
1818
}()
1919
// 显示信息,匹配路由之后不做代理
2020
if req.Method == "GET" && !req.URL.IsAbs() && req.URL.Path == "/info" {
21-
res.Write([]byte("This is PlayProxy."))
21+
res.Write([]byte("This is ShadowProxy."))
2222
return true
2323
}
2424
return false

server/page.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import (
88
func serveHiddenPage(res http.ResponseWriter, authErr error) {
99
const hiddenPage = `<html>
1010
<head>
11-
<title>PlayProxy</title>
11+
<title>ShadowProxy</title>
1212
</head>
1313
<body>
14-
<h1>PlayProxy Hidden Proxy Page!</h1>
14+
<h1>ShadowProxy Hidden Proxy Page!</h1>
1515
%s<br/>
1616
</body>
1717
</html>`

server/proxy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import (
44
"bufio"
55
"context"
66
"errors"
7+
"github.com/nisainan/shadowproxy/util"
78
"io"
89
"log"
910
"net"
1011
"net/http"
11-
"playproxy/util"
1212
)
1313

1414
func (s *Server) onRequestProxy(ctx context.Context, res http.ResponseWriter, req *http.Request) {

server/server.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import (
44
"context"
55
"encoding/base64"
66
"fmt"
7+
"github.com/nisainan/shadowproxy/confer"
8+
"github.com/nisainan/shadowproxy/util"
79
"log"
810
"net"
911
"net/http"
10-
"playproxy/confer"
11-
"playproxy/util"
1212
"sync"
1313
"time"
1414
)

0 commit comments

Comments
 (0)