good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jrpc
Manage
Activity
Members
Labels
Plan
Issues
6
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
jrpc
Commits
bb5192aa
Commit
bb5192aa
authored
1 year ago
by
Garet Halliday
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-tcp' into 'master'
fix tcp dialer See merge request
!29
parents
46fce591
8dc453ec
No related branches found
No related tags found
1 merge request
!29
fix tcp dialer
Pipeline
#32689
passed with stage
Stage: test
in 5 minutes and 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/codecs/init.go
+8
-5
8 additions, 5 deletions
contrib/codecs/init.go
with
8 additions
and
5 deletions
contrib/codecs/init.go
+
8
−
5
View file @
bb5192aa
...
...
@@ -3,11 +3,10 @@ package codecs
import
(
"context"
"net"
gohttp
"net/http"
"net/url"
"strings"
gohttp
"net/http"
"gfx.cafe/open/jrpc/contrib/codecs/http"
"gfx.cafe/open/jrpc/contrib/codecs/rdwr"
"gfx.cafe/open/jrpc/contrib/codecs/websocket"
...
...
@@ -30,7 +29,7 @@ func init() {
},
"http+ws"
)
RegisterHandler
(
func
(
bind
*
url
.
URL
,
srv
*
server
.
Server
,
opts
map
[
string
]
any
)
error
{
tcpAddr
,
err
:=
net
.
ResolveTCPAddr
(
"tcp"
,
bind
.
String
()
)
tcpAddr
,
err
:=
net
.
ResolveTCPAddr
(
"tcp"
,
bind
.
Host
)
if
err
!=
nil
{
return
err
}
...
...
@@ -56,8 +55,12 @@ func init() {
return
websocket
.
DialWebsocket
(
ctx
,
url
,
""
)
},
"wss"
,
"ws"
)
RegisterDialer
(
func
(
ctx
context
.
Context
,
url
string
)
(
jsonrpc
.
Conn
,
error
)
{
tcpAddr
,
err
:=
net
.
ResolveTCPAddr
(
"tcp"
,
url
)
RegisterDialer
(
func
(
ctx
context
.
Context
,
u
string
)
(
jsonrpc
.
Conn
,
error
)
{
pu
,
err
:=
url
.
Parse
(
u
)
if
err
!=
nil
{
return
nil
,
err
}
tcpAddr
,
err
:=
net
.
ResolveTCPAddr
(
"tcp"
,
pu
.
Host
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment