Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-proxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-proxy
Commits
625a7061
Commit
625a7061
authored
Sep 12, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update log
parent
ab41ee07
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
proxy.go
proxy.go
+4
-4
No files found.
proxy.go
View file @
625a7061
...
@@ -37,7 +37,7 @@ func ygoEndpoint(w http.ResponseWriter, r *http.Request) {
...
@@ -37,7 +37,7 @@ func ygoEndpoint(w http.ResponseWriter, r *http.Request) {
tcp
,
err
:=
net
.
Dial
(
"tcp"
,
"127.0.0.1"
+
PROXY_PORT
)
tcp
,
err
:=
net
.
Dial
(
"tcp"
,
"127.0.0.1"
+
PROXY_PORT
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
"Connect tcp server error: "
,
err
)
log
.
Fatal
(
err
)
}
}
log
.
Println
(
"Tcp connected"
)
log
.
Println
(
"Tcp connected"
)
...
@@ -54,7 +54,7 @@ func wsProxy(ws *websocket.Conn, tcp *net.Conn, wg *sync.WaitGroup) {
...
@@ -54,7 +54,7 @@ func wsProxy(ws *websocket.Conn, tcp *net.Conn, wg *sync.WaitGroup) {
for
{
for
{
messageType
,
buffer
,
err
:=
ws
.
ReadMessage
()
messageType
,
buffer
,
err
:=
ws
.
ReadMessage
()
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Println
(
"Websocket read message error: "
,
err
)
log
.
Println
(
err
)
break
break
}
}
...
@@ -71,7 +71,7 @@ func wsProxy(ws *websocket.Conn, tcp *net.Conn, wg *sync.WaitGroup) {
...
@@ -71,7 +71,7 @@ func wsProxy(ws *websocket.Conn, tcp *net.Conn, wg *sync.WaitGroup) {
_
,
err
=
(
*
tcp
)
.
Write
(
buffer
)
_
,
err
=
(
*
tcp
)
.
Write
(
buffer
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
"Tcp send message error: "
,
err
)
log
.
Fatal
(
err
)
break
break
}
}
}
}
...
@@ -102,7 +102,7 @@ func tcpProxy(tcp *net.Conn, ws *websocket.Conn, wg *sync.WaitGroup) {
...
@@ -102,7 +102,7 @@ func tcpProxy(tcp *net.Conn, ws *websocket.Conn, wg *sync.WaitGroup) {
err
=
ws
.
WriteMessage
(
websocket
.
BinaryMessage
,
buffer
)
err
=
ws
.
WriteMessage
(
websocket
.
BinaryMessage
,
buffer
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
"Websocket send message error: "
,
err
)
log
.
Fatal
(
err
)
break
break
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment