forked from ms/transocks
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
22397c6815 | |||
7bfa2786db | |||
6fdd75fbb0 | |||
c692b8881d | |||
ffbd6b14fa |
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [1.1.4](https://git.mousesoft.ru/alexey/transocks/releases/tag/v1.1.4) - 2024-11-05
|
||||||
|
|
||||||
|
- **Fixed**
|
||||||
|
- Bug in method `Server.handleConnection`.
|
||||||
|
|
||||||
## [1.1.3](https://git.mousesoft.ru/alexey/transocks/releases/tag/v1.1.3) - 2024-11-03
|
## [1.1.3](https://git.mousesoft.ru/alexey/transocks/releases/tag/v1.1.3) - 2024-11-03
|
||||||
|
|
||||||
- **Added**
|
- **Added**
|
||||||
|
10
configs/transocks.example.toml
Normal file
10
configs/transocks.example.toml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# listening address of transocks.
|
||||||
|
listen = "localhost:1081" # default is "localhost:1081"
|
||||||
|
|
||||||
|
#proxy_url = "socks5://10.20.30.40:1080" # for SOCKS5 server
|
||||||
|
#proxy_url = "http://10.20.30.40:3128" # for HTTP proxy server
|
||||||
|
|
||||||
|
[log]
|
||||||
|
#filename = "/path/to/file" # default to stderr
|
||||||
|
level = "info" # critical", error, warning, info, debug
|
||||||
|
#format = "json" # plain, logfmt, json
|
25
makefile
25
makefile
@ -35,8 +35,8 @@ PKG_NAME := $(PROJECT_ID)_$(VERSION)_$(GOOS)-$(GOARCH)
|
|||||||
DIST_FILE := $(PKG_NAME)$(DIST_EXT)
|
DIST_FILE := $(PKG_NAME)$(DIST_EXT)
|
||||||
PKG_ARCH := $(GOARCH)
|
PKG_ARCH := $(GOARCH)
|
||||||
|
|
||||||
ifeq ($(GOARCH),arm)
|
ifeq ($(PKG_ARCH),arm)
|
||||||
PKG_ARH := armv7l
|
PKG_ARCH = armhf
|
||||||
endif
|
endif
|
||||||
|
|
||||||
GREEN := $(shell tput -Txterm setaf 2)
|
GREEN := $(shell tput -Txterm setaf 2)
|
||||||
@ -94,24 +94,25 @@ DEB_NAME := $(PROJECT_ID)_$(VERSION_NUMBER)-1_$(PKG_ARCH)
|
|||||||
|
|
||||||
pkg-deb: ## Build debian package
|
pkg-deb: ## Build debian package
|
||||||
@rm -rf $(TMPDIR)
|
@rm -rf $(TMPDIR)
|
||||||
@mkdir -p $(TMPDIR)/$(DEB_NAME)/usr/bin
|
|
||||||
@mkdir -p $(TMPDIR)/$(DEB_NAME)/debian
|
|
||||||
@mkdir -p $(TMPDIR)/$(DEB_NAME)/DEBIAN
|
@mkdir -p $(TMPDIR)/$(DEB_NAME)/DEBIAN
|
||||||
|
@mkdir -p $(TMPDIR)/$(DEB_NAME)/etc
|
||||||
|
@mkdir -p $(TMPDIR)/$(DEB_NAME)/usr/bin
|
||||||
|
@cp $(CURDIR)/configs/transocks.example.toml $(TMPDIR)/$(DEB_NAME)/etc/transocks.toml
|
||||||
@cp -a $(BINDIR)/* $(TMPDIR)/$(DEB_NAME)/usr/bin/
|
@cp -a $(BINDIR)/* $(TMPDIR)/$(DEB_NAME)/usr/bin/
|
||||||
@sed -e "s/VERSION/$(VERSION_NUMBER)/g" \
|
@sed -e "s/VERSION/$(VERSION_NUMBER)/g" \
|
||||||
$(CURDIR)/build/package/debian/changelog.tpl \
|
$(CURDIR)/build/package/debian/changelog.tpl \
|
||||||
> $(TMPDIR)/$(DEB_NAME)/changelog
|
> $(TMPDIR)/changelog
|
||||||
@sed -e "s/ARCH/$(PKG_ARCH)/g" $(CURDIR)/build/package/debian/control.tpl \
|
@sed -e "s/ARCH/$(PKG_ARCH)/g" $(CURDIR)/build/package/debian/control.tpl \
|
||||||
> $(TMPDIR)/$(DEB_NAME)/control
|
> $(TMPDIR)/control
|
||||||
DEB_HOST_ARCH=$(PKG_ARCH) dpkg-gencontrol -v$(VERSION_NUMBER)-1 \
|
DEB_HOST_ARCH=$(PKG_ARCH) dpkg-gencontrol -v$(VERSION_NUMBER)-1 \
|
||||||
-c$(TMPDIR)/$(DEB_NAME)/control \
|
-c$(TMPDIR)/control \
|
||||||
-l$(TMPDIR)/$(DEB_NAME)/changelog \
|
-l$(TMPDIR)/changelog \
|
||||||
-f$(TMPDIR)/$(DEB_NAME)/debian/files -Ptmp/$(DEB_NAME)
|
-f$(TMPDIR)/$(DEB_NAME)/DEBIAN/files -Ptmp/$(DEB_NAME)
|
||||||
dpkg-deb --build --root-owner-group $(TMPDIR)/$(DEB_NAME)
|
dpkg-deb --build --root-owner-group $(TMPDIR)/$(DEB_NAME)
|
||||||
dpkg-genchanges --build=binary \
|
dpkg-genchanges --build=binary \
|
||||||
-c$(TMPDIR)/$(DEB_NAME)/control \
|
-c$(TMPDIR)/control \
|
||||||
-l$(TMPDIR)/$(DEB_NAME)/changelog \
|
-l$(TMPDIR)/changelog \
|
||||||
-f$(TMPDIR)/$(DEB_NAME)/debian/files \
|
-f$(TMPDIR)/$(DEB_NAME)/DEBIAN/files \
|
||||||
-u$(TMPDIR) -O$(OUTDIR)/$(DEB_NAME).changes
|
-u$(TMPDIR) -O$(OUTDIR)/$(DEB_NAME).changes
|
||||||
@mv $(TMPDIR)/*.deb $(OUTDIR)/
|
@mv $(TMPDIR)/*.deb $(OUTDIR)/
|
||||||
@$(ECHO_CMD) "pkg-deb\t\t${GREEN}[OK]${RESET}"
|
@$(ECHO_CMD) "pkg-deb\t\t${GREEN}[OK]${RESET}"
|
||||||
|
@ -144,10 +144,11 @@ func (s *Server) handleConnection(ctx context.Context, conn net.Conn) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
fields[log.FnError] = err.Error()
|
fields[log.FnError] = err.Error()
|
||||||
_ = s.logger.Warn("peekHTTP failed", fields)
|
_ = s.logger.Warn("peekHTTP failed", fields)
|
||||||
} else {
|
} else if host != "" {
|
||||||
if err == nil && host != "" {
|
if strings.Contains(host, ":") {
|
||||||
addr = host + addr[strings.Index(addr, ":"):]
|
host = host[:strings.Index(host, ":")]
|
||||||
}
|
}
|
||||||
|
addr = host + addr[strings.Index(addr, ":"):]
|
||||||
}
|
}
|
||||||
reader = reader_n3
|
reader = reader_n3
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user