Skip to content

url-file, SOCKS5-авторизация/счётчики и мелкие фиксы транспорта - #57

Open
damnurmum wants to merge 1 commit into
p1neappleXpress:mainfrom
damnurmum:contrib/url-file-socks5-improvements
Open

url-file, SOCKS5-авторизация/счётчики и мелкие фиксы транспорта#57
damnurmum wants to merge 1 commit into
p1neappleXpress:mainfrom
damnurmum:contrib/url-file-socks5-improvements

Conversation

@damnurmum

Copy link
Copy Markdown
Contributor

Что добавлено

  • --url-file - читать ссылку на документ из файла вместо --url, чтобы она не светилась в аргументах процесса/истории шелла на общем хосте exit node.
  • SOCKS5-сервер: авторизация по логину/паролю (RFC 1929, SetAuth), счётчики трафика (BytesSent/BytesReceived) для индикатора живой скорости, нормальные коды ошибок RFC 1928 (host-unreachable, command-not-supported, address-not-supported) вместо тихого обрыва соединения на неподдерживаемом запросе. Добавлены тесты.
  • tunnel.DialTCP: разбор host:port через net.SplitHostPort вместо net.ResolveTCPAddr, с отдельным хелпером resolveIPv4 - понятнее ошибки, поведение то же.
  • transport/yandex: YandexDocsTransport.Stop() теперь закрывает WebSocket-соединение вместо утечки, и интервал поллинга очереди отправки уменьшен с 10мс до 1мс (при пульсирующем/ack-clocked трафике очередь наполняется и опустошается быстрее старых 10мс, что ограничивало throughput независимо от сети и CPU).

Всё это уже какое-то время работает в бою в форке (damnurmum/OpenFlux-Android).

Тестирование

  • go build ./..., go vet ./..., go test ./... -race - зелёные.
  • SOCKS5-авторизация и счётчики трафика используются в проде Android-приложения форка (режим Proxy с доступом из локальной сети).

- --url-file: read the document URL from a file instead of --url, so it
  doesn't sit in the process arguments/shell history on a shared exit-node
  host.
- socks5: RFC 1929 username/password auth (SetAuth), running byte counters
  (BytesSent/BytesReceived) for a live speed indicator, and proper RFC 1928
  error replies (host-unreachable, command-not-supported, address-not-
  supported) instead of silently closing the connection on an unsupported
  request. Tests included.
- tunnel.DialTCP: parse host:port with net.SplitHostPort instead of
  net.ResolveTCPAddr, with a dedicated resolveIPv4 helper - clearer errors,
  same behavior.
- transport/yandex: YandexDocsTransport.Stop() now closes the underlying
  WebSocket connection instead of leaking it, and the writer loop's idle
  poll interval is 1ms instead of 10ms (under bursty/ack-clocked traffic
  the queue drains and refills faster than 10ms, capping throughput
  independent of the network or CPU).

All of this has been running in production in a fork (damnurmum/OpenFlux-
Android) for a while.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant