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
a90eadb8
Commit
a90eadb8
authored
Sep 15, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update small
parent
625a7061
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 @
a90eadb8
...
...
@@ -51,6 +51,8 @@ func ygoEndpoint(w http.ResponseWriter, r *http.Request) {
}
func
wsProxy
(
ws
*
websocket
.
Conn
,
tcp
*
net
.
Conn
,
wg
*
sync
.
WaitGroup
)
{
defer
wg
.
Done
()
for
{
messageType
,
buffer
,
err
:=
ws
.
ReadMessage
()
if
err
!=
nil
{
...
...
@@ -75,11 +77,11 @@ func wsProxy(ws *websocket.Conn, tcp *net.Conn, wg *sync.WaitGroup) {
break
}
}
wg
.
Done
()
}
func
tcpProxy
(
tcp
*
net
.
Conn
,
ws
*
websocket
.
Conn
,
wg
*
sync
.
WaitGroup
)
{
defer
wg
.
Done
()
reader
:=
bufio
.
NewReader
(
*
tcp
)
buffer
:=
make
([]
byte
,
BUFFER_SIZE
)
...
...
@@ -106,8 +108,6 @@ func tcpProxy(tcp *net.Conn, ws *websocket.Conn, wg *sync.WaitGroup) {
break
}
}
wg
.
Done
()
}
func
wsChecker
(
r
*
http
.
Request
)
bool
{
return
true
}
...
...
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