You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: syncconn.go
    path of file: ./repos/cellnet/peer/gorillaws
    
    the code of the file until where you have to start completion: package gorillaws

import (
	"github.com/davyxu/cellnet"
	"github.com/davyxu/cellnet/peer"
	"github.com/gorilla/websocket"
	"net"
	"net/http"
	"strings"
	"time"
)

type wsSyncConnector struct {
	peer.SessionManager

	peer.CorePeerProperty
	peer.CoreContextSet
	peer.CoreProcBundle
	peer.CoreTCPSocketOption

	defaultSes *wsSession
}

func (self *wsSyncConnector) Port() int {
	if self.defaultSes.conn == nil {
		return 0
	}

	return self.defaultSes.conn.LocalAddr().(*net.TCPAddr).Port
}

func (self *wsSyncConnector) Start() cellnet.Peer {

	dialer := websocket.Dialer{}
	dialer.Proxy = http.
    
func (self *wsSyncConnector) Start() cellnet.Peer {

	dialer := websocket.Dialer{}
	dialer.Proxy = http.ProxyFromEnvironment
	dialer.HandshakeTimeout = 45 * time.Second

	var finalAddress string
	if !strings.HasPrefix(self.Address(), "ws://") {
		finalAddress = "ws://" + self.Address()
	}

	conn, _, err := dialer.Dial(finalAddress, nil)

	// 发生错误时退出
	if err != nil {

		log.Debugf("#ws.connect failed(%s)@%d address: %s", self.Name(), self.defaultSes.ID(), self.Address())

		self.ProcEvent(&cellnet.RecvMsgEvent{Ses: self.defaultSes, Msg: &cellnet.SessionConnectError{}})
		return self
	}

	self.defaultSes.conn = conn

	self.defaultSes.Start()

	self.ProcEvent(&cellnet.RecvMsgEvent{Ses: self.defaultSes, Msg: &cellnet.SessionConnected{}})

	return self
}