Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chisel
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
anun
chisel
Commits
9302bd7f
Commit
9302bd7f
authored
Jun 20, 2024
by
anun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api get list client
parent
777d595a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
Dockerfile
+3
-3
chisel
+0
-0
server/server_handler.go
+14
-5
No files found.
Dockerfile
View file @
9302bd7f
...
...
@@ -5,7 +5,8 @@ ADD . /src
WORKDIR
/src
ENV
CGO_ENABLED 0
RUN
go build
\
-ldflags
"-X dev.nexpie.com/anun/chisel/share.BuildVersion=
$(
git describe
--abbrev
=
0
--tags
)
"
\
# -ldflags "-X dev.nexpie.com/anun/chisel/share.BuildVersion=$(git describe --abbrev=0 --tags)"
\
-ldflags
"-X dev.nexpie.com/anun/chisel/share.BuildVersion=main"
\
-o
/tmp/bin
# run stage
FROM
scratch
...
...
@@ -13,4 +14,4 @@ LABEL maintainer="dev@jpillora.com"
COPY
--from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
WORKDIR
/app
COPY
--from=build /tmp/bin /app/bin
ENTRYPOINT
["/app/bin"]
\ No newline at end of file
ENTRYPOINT
["/app/bin"]
chisel
View file @
9302bd7f
No preview for this file type
server/server_handler.go
View file @
9302bd7f
...
...
@@ -77,7 +77,8 @@ func (s *Server) handleClientHandler(w http.ResponseWriter, r *http.Request) {
case
"/version"
:
w
.
Write
([]
byte
(
chshare
.
BuildVersion
))
return
case
"/register"
:
/*
case "/regport":
ltn, err := getTCPPort()
if err != nil {
w.WriteHeader(500)
...
...
@@ -85,6 +86,14 @@ func (s *Server) handleClientHandler(w http.ResponseWriter, r *http.Request) {
}
w.Write([]byte(strconv.Itoa(ltn)))
return
*/
case
"/client"
:
s
.
Debugf
(
"---> session : %s"
,
s
.
sessions
)
s
.
Debugf
(
"---> user : %s"
,
s
.
users
.
Len
())
w
.
Write
([]
byte
(
"Client list:
\n
"
))
w
.
Write
([]
byte
(
strconv
.
Itoa
(
s
.
users
.
Len
())))
return
}
//missing :O
w
.
WriteHeader
(
404
)
...
...
@@ -235,10 +244,10 @@ func (s *Server) handleWebsocket(w http.ResponseWriter, req *http.Request) {
l
.
Debugf
(
"Closed connection (%s)"
,
err
)
}
else
{
l
.
Debugf
(
"Closed connection"
)
}
if
len
(
edge
)
!=
0
{
l
.
Debugf
(
"Disable tunnel port %d"
,
edge
[
0
]
.
Tunnelbrokerport
)
updateConnectionEdge
(
s
.
db
,
edge
[
0
]
.
Edgeid
,
edge
[
0
]
.
Edgesecret
,
edge
[
0
]
.
Tunnelbrokerport
,
false
)
if
len
(
edge
)
!=
0
{
l
.
Debugf
(
"Disable tunnel port %d"
,
edge
[
0
]
.
Tunnelbrokerport
)
updateConnectionEdge
(
s
.
db
,
edge
[
0
]
.
Edgeid
,
edge
[
0
]
.
Edgesecret
,
edge
[
0
]
.
Tunnelbrokerport
,
false
)
}
}
}
...
...
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