Skip to content

Commit 468cfc3

Browse files
authored
fix: set sni to servername if not specified for trojan outbound (#1991)
1 parent 5dce957 commit 468cfc3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

adapter/outbound/trojan.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ func (t *Trojan) Close() error {
295295
func NewTrojan(option TrojanOption) (*Trojan, error) {
296296
addr := net.JoinHostPort(option.Server, strconv.Itoa(option.Port))
297297

298+
if option.SNI == "" {
299+
option.SNI = option.Server
300+
}
301+
298302
t := &Trojan{
299303
Base: &Base{
300304
name: option.Name,

0 commit comments

Comments
 (0)