mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-19 15:54:26 +00:00
https://github.com/XTLS/Xray-core/pull/6210#issuecomment-4573680059 https://github.com/XTLS/Xray-core/pull/6210#issuecomment-4582554889 https://github.com/XTLS/Xray-core/pull/6210#issuecomment-4937008835
28 lines
557 B
Go
28 lines
557 B
Go
package xmc
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
)
|
|
|
|
func (c *Config) TCP() {
|
|
}
|
|
|
|
func (c *Config) WrapConnClient(conn net.Conn) (net.Conn, error) {
|
|
cc, err := newClientConn(conn, c.Usernames, c.Password, c.RsaPublicKey, c.Hostname)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("minecraft finalmask: %w", err)
|
|
}
|
|
|
|
return cc, nil
|
|
}
|
|
|
|
func (c *Config) WrapConnServer(conn net.Conn) (net.Conn, error) {
|
|
cc, err := wrapConnServer(conn, c.Password, c.RsaPrivateKey, c.RsaPublicKey)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("minecraft finalmask: %w", err)
|
|
}
|
|
|
|
return cc, nil
|
|
}
|