Compare commits

...

5 Commits

Author SHA1 Message Date
22397c6815
В deb пакет добавлен файл конфигурации.
All checks were successful
build / build (push) Successful in 1m28s
release / release (push) Successful in 1m10s
2024-11-06 07:38:55 +07:00
7bfa2786db
Исправлена сборка debian-пакеьа.
All checks were successful
build / build (push) Successful in 1m29s
2024-11-06 02:44:28 +07:00
6fdd75fbb0
updated changelog
All checks were successful
build / build (push) Successful in 1m50s
release / release (push) Successful in 1m29s
2024-11-05 14:34:30 +07:00
c692b8881d
Исправлен баг в методе Server.handleConnection
Some checks failed
build / build (push) Has been cancelled
2024-11-05 14:33:11 +07:00
ffbd6b14fa
Fixed bug "too many colons in address".
All checks were successful
build / build (push) Successful in 1m25s
2024-11-04 15:13:12 +07:00
4 changed files with 32 additions and 15 deletions

View File

@ -2,6 +2,11 @@
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
- **Added**

View 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

View File

@ -35,8 +35,8 @@ PKG_NAME := $(PROJECT_ID)_$(VERSION)_$(GOOS)-$(GOARCH)
DIST_FILE := $(PKG_NAME)$(DIST_EXT)
PKG_ARCH := $(GOARCH)
ifeq ($(GOARCH),arm)
PKG_ARH := armv7l
ifeq ($(PKG_ARCH),arm)
PKG_ARCH = armhf
endif
GREEN := $(shell tput -Txterm setaf 2)
@ -94,24 +94,25 @@ DEB_NAME := $(PROJECT_ID)_$(VERSION_NUMBER)-1_$(PKG_ARCH)
pkg-deb: ## Build debian package
@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)/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/
@sed -e "s/VERSION/$(VERSION_NUMBER)/g" \
$(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 \
> $(TMPDIR)/$(DEB_NAME)/control
> $(TMPDIR)/control
DEB_HOST_ARCH=$(PKG_ARCH) dpkg-gencontrol -v$(VERSION_NUMBER)-1 \
-c$(TMPDIR)/$(DEB_NAME)/control \
-l$(TMPDIR)/$(DEB_NAME)/changelog \
-f$(TMPDIR)/$(DEB_NAME)/debian/files -Ptmp/$(DEB_NAME)
-c$(TMPDIR)/control \
-l$(TMPDIR)/changelog \
-f$(TMPDIR)/$(DEB_NAME)/DEBIAN/files -Ptmp/$(DEB_NAME)
dpkg-deb --build --root-owner-group $(TMPDIR)/$(DEB_NAME)
dpkg-genchanges --build=binary \
-c$(TMPDIR)/$(DEB_NAME)/control \
-l$(TMPDIR)/$(DEB_NAME)/changelog \
-f$(TMPDIR)/$(DEB_NAME)/debian/files \
-c$(TMPDIR)/control \
-l$(TMPDIR)/changelog \
-f$(TMPDIR)/$(DEB_NAME)/DEBIAN/files \
-u$(TMPDIR) -O$(OUTDIR)/$(DEB_NAME).changes
@mv $(TMPDIR)/*.deb $(OUTDIR)/
@$(ECHO_CMD) "pkg-deb\t\t${GREEN}[OK]${RESET}"

View File

@ -144,10 +144,11 @@ func (s *Server) handleConnection(ctx context.Context, conn net.Conn) {
if err != nil {
fields[log.FnError] = err.Error()
_ = s.logger.Warn("peekHTTP failed", fields)
} else {
if err == nil && host != "" {
addr = host + addr[strings.Index(addr, ":"):]
} else if host != "" {
if strings.Contains(host, ":") {
host = host[:strings.Index(host, ":")]
}
addr = host + addr[strings.Index(addr, ":"):]
}
reader = reader_n3
}