Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Commit

Permalink
SOCKS5 proxy will work correctly when dealing with socket sending dat…
Browse files Browse the repository at this point in the history
…a first
  • Loading branch information
zhuhaow committed Dec 9, 2016
1 parent 0bf5b26 commit bc6ff80
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
I will do my best to guarantee that this project adheres to [Semantic Versioning](http://semver.org/) after 1.0.0, but please do read change log before updating.

## 0.10.1

### Fixed
- SOCKS5 proxy will work correctly when dealing with socket sending data first.

## 0.10.0

### Changed
Expand Down
11 changes: 11 additions & 0 deletions src/Socket/ProxySocket/SOCKS5ProxySocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ public class SOCKS5ProxySocket: ProxySocket {
socket.readDataTo(length: 2)
}

public override func write(data: Data) {
switch internalStatus {
case .waitingToForward:
internalStatus = .forwarding
default:
break
}

super.write(data: data)
}

// swiftlint:disable function_body_length
// swiftlint:disable cyclomatic_complexity
/**
Expand Down

0 comments on commit bc6ff80

Please sign in to comment.