Commit 9f3072d
committed
Simplify handleProxyConn: use io.Copy and close targetConn
Replace the manual read/write loops and sync.Once/closeBoth with
io.Copy and a simple targetConn.Close() after the client→target
direction finishes — the same pattern already used in startFakeTLSProxy
in the same file.1 parent 868d368 commit 9f3072d
1 file changed
Lines changed: 10 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
117 | 109 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
130 | 113 | | |
131 | 114 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 115 | + | |
| 116 | + | |
144 | 117 | | |
145 | | - | |
146 | | - | |
| 118 | + | |
147 | 119 | | |
148 | 120 | | |
149 | 121 | | |
| |||
0 commit comments