File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 9
9
)
10
10
11
11
// Info struct
12
- // PostBird 에서 사용될 내용
12
+ // PostBird 에서 사용될 값들
13
13
type Info struct {
14
14
BindPort uint
15
15
BindAddress string
@@ -20,14 +20,15 @@ type Info struct {
20
20
21
21
const DefaultPort uint = 8787 // Default Bind Port
22
22
const DefaultBindAddress string = "127.0.0.1" // Default Bind Address
23
- const DefaultServerAddress string = "127.0.0.1" // Defualt Server Address
23
+ const DefaultRemoteAddress string = "127.0.0.1" // Defualt Server Address
24
24
25
25
const (
26
26
ServerMode = 0
27
27
ClientMode = 1
28
28
)
29
29
30
30
var info Info
31
+ var ServerConnection net.Conn
31
32
32
33
// funcs map
33
34
// 원격에서 호출가능한 함수들을 등록해놓은 map
@@ -69,7 +70,7 @@ func init() {
69
70
}
70
71
71
72
if info .RemoteAddress == "" {
72
- info .RemoteAddress = DefaultBindAddress
73
+ info .RemoteAddress = DefaultRemoteAddress
73
74
}
74
75
75
76
if info .RemotePort == 0 {
@@ -137,8 +138,13 @@ func requestHandler(c net.Conn) {
137
138
}
138
139
}
139
140
140
- func Connect () {
141
-
141
+ func ConnectToRemote () {
142
+ client , err := net .Dial ("tcp" , info .RemoteAddress + ":" + string (info .RemotePort ))
143
+ if err != nil {
144
+ fmt .Println (err )
145
+ return
146
+ }
147
+ ServerConnection = client
142
148
}
143
149
144
150
// CallLocalFunc func
You can’t perform that action at this time.
0 commit comments