Skip to content

Commit

Permalink
Merge branch 'release/0.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Dec 8, 2020
2 parents 35ed570 + 9c5b20c commit edb8eca
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [0.4.1] - 2020-12-08
### Changed
* (internal) Specify buffer sizes

### Fixed
* Fix hint to show socat hint when --yamux not specified

## [0.4.0] - 2020-12-06
### Added
* Multiplexing with [hashicorp/yamux](https://github.com/hashicorp/yamux) and add --yamux flag
Expand Down Expand Up @@ -44,7 +51,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
### Added
* Initial release

[Unreleased]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.4.0...HEAD
[Unreleased]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.4.1...HEAD
[0.4.1]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.3.1...v0.4.0
[0.3.1]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/nwtgck/go-piping-tunnel/compare/v0.2.2...v0.3.0
Expand Down
10 changes: 6 additions & 4 deletions cmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,14 @@ func clientHandleWithYamux(ln net.Listener, httpClient *http.Client, headers []p
return err
}
go func() {
// TODO: specify buffer
io.Copy(yamuxStream, conn)
// TODO: hard code
var buf = make([]byte, 16)
io.CopyBuffer(yamuxStream, conn, buf)
}()
go func() {
// TODO: specify buffer
io.Copy(conn, yamuxStream)
// TODO: hard code
var buf = make([]byte, 16)
io.CopyBuffer(conn, yamuxStream, buf)
}()
}
return nil
Expand Down
12 changes: 8 additions & 4 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ var serverCmd = &cobra.Command{
}

func printHintForClientHost(clientToServerUrl string, serverToClientUrl string, clientToServerPath string, serverToClientPath string) {
if serverYamux {
if !serverYamux {
fmt.Println("[INFO] Hint: Client host (socat + curl)")
fmt.Printf(
" socat TCP-LISTEN:31376 'EXEC:curl -NsS %s!!EXEC:curl -NsST - %s'\n",
Expand Down Expand Up @@ -150,7 +150,7 @@ func serverHandleWithYamux(httpClient *http.Client, headers []piping_tunnel_util
return err
}
for {
yamuxSession, err := yamuxSession.Accept()
yamuxStream, err := yamuxSession.Accept()
if err != nil {
return err
}
Expand All @@ -159,10 +159,14 @@ func serverHandleWithYamux(httpClient *http.Client, headers []piping_tunnel_util
return err
}
go func() {
io.Copy(yamuxSession, conn)
// TODO: hard code
var buf = make([]byte, 16)
io.CopyBuffer(yamuxStream, conn, buf)
}()
go func() {
io.Copy(conn, yamuxSession)
// TODO: hard code
var buf = make([]byte, 16)
io.CopyBuffer(conn, yamuxStream, buf)
}()
}
return nil
Expand Down
4 changes: 3 additions & 1 deletion piping-tunnel-util/duplex.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ func NewPipingDuplex(httpClient *http.Client, headers []KeyValue, uploadPath, do

go func() {
res, _ := httpClient.Do(req)
io.Copy(downloadPw, res.Body)
// TODO: hard code
var buf = make([]byte, 16)
io.CopyBuffer(downloadPw, res.Body, buf)
}()

return &PipingDuplex{
Expand Down
5 changes: 3 additions & 2 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ func NewIOProgressReadWriteCloser(duplex io.ReadWriteCloser, messageWriter io.Wr
pr, pw := io.Pipe()
p := io_progress.NewIOProgress(pr, messageWriter, makeMessage)
go func() {
// TODO: specify buffer
io.Copy(duplex, &p)
// TODO: hard code
var buf = make([]byte, 16)
io.CopyBuffer(duplex, &p, buf)
}()
return IOProgressReadWriteCloser{
pw: pw,
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package version

const Version = "0.4.0"
const Version = "0.4.1"

0 comments on commit edb8eca

Please sign in to comment.