Skip to content

Commit fa2234d

Browse files
committed
TUN-6185: Fix tcpOverWSOriginService not using original scheme for String representation
1 parent 99d4e48 commit fa2234d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ingress/origin_service.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ func (o rawTCPService) MarshalJSON() ([]byte, error) {
109109
// tcpOverWSService models TCP origins serving eyeballs connecting over websocket, such as
110110
// cloudflared access commands.
111111
type tcpOverWSService struct {
112+
scheme string
112113
dest string
113114
isBastion bool
114115
streamHandler streamHandlerFunc
@@ -130,7 +131,8 @@ func newTCPOverWSService(url *url.URL) *tcpOverWSService {
130131
addPortIfMissing(url, 7864) // just a random port since there isn't a default in this case
131132
}
132133
return &tcpOverWSService{
133-
dest: url.Host,
134+
scheme: url.Scheme,
135+
dest: url.Host,
134136
}
135137
}
136138

@@ -160,7 +162,12 @@ func (o *tcpOverWSService) String() string {
160162
if o.isBastion {
161163
return ServiceBastion
162164
}
163-
return o.dest
165+
166+
if o.scheme != "" {
167+
return fmt.Sprintf("%s://%s", o.scheme, o.dest)
168+
} else {
169+
return o.dest
170+
}
164171
}
165172

166173
func (o *tcpOverWSService) start(log *zerolog.Logger, _ <-chan struct{}, cfg OriginRequestConfig) error {

0 commit comments

Comments
 (0)