Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
150
Issues
150
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
ea87bb15
Verified
Commit
ea87bb15
authored
Jun 13, 2024
by
Przemyslaw Kaminski
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[websockets] fix routing (frontend is a catch-all)
parent
f824ffaf
Pipeline
#6223
failed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
Named.hs
src/Gargantext/API/Routes/Named.hs
+2
-1
Named.hs
src/Gargantext/API/Server/Named.hs
+1
-1
Dispatcher.hs
src/Gargantext/Core/AsyncUpdates/Dispatcher.hs
+2
-3
No files found.
src/Gargantext/API/Routes/Named.hs
View file @
ea87bb15
...
...
@@ -44,8 +44,9 @@ data NamedAPI mode = NamedAPI
{
swaggerAPI
::
mode
:-
SwaggerSchemaUI
"swagger-ui"
"swagger.json"
,
backendAPI
::
mode
:-
NamedRoutes
BackEndAPI
,
graphqlAPI
::
mode
:-
NamedRoutes
GraphQLAPI
,
frontendAPI
::
mode
:-
FrontEndAPI
,
wsAPI
::
mode
:-
NamedRoutes
Dispatcher
.
WSAPI
-- NOTE: FrontEndAPI is Raw and is a catch-all so needs to be at the end!
,
frontendAPI
::
mode
:-
FrontEndAPI
}
deriving
Generic
...
...
src/Gargantext/API/Server/Named.hs
View file @
ea87bb15
...
...
@@ -61,12 +61,12 @@ server env =
(
Proxy
::
Proxy
AuthContext
)
(
transformJSONGQL
errScheme
)
GraphQL
.
api
,
frontendAPI
=
frontEndServer
,
wsAPI
=
hoistServer
(
Proxy
::
Proxy
(
NamedRoutes
Dispatcher
.
WSAPI
))
-- (Proxy :: Proxy AuthContext)
(
transformJSON
errScheme
)
Dispatcher
.
wsServer
,
frontendAPI
=
frontEndServer
}
where
transformJSON
::
forall
a
.
GargErrorScheme
->
GargM
Env
BackendInternalError
a
->
Handler
a
...
...
src/Gargantext/Core/AsyncUpdates/Dispatcher.hs
View file @
ea87bb15
...
...
@@ -108,8 +108,7 @@ newtype WSAPI mode = WSAPI {
wsAPIServer
::
mode
:-
"ws"
:>
Summary
"WebSocket endpoint"
:>
WS
.
WebSocketPending
}
deriving
Generic
-- wsServer :: IsGargServer env err m => Settings -> SSet.Set Subscription -> WSAPI (AsServerT m)
-- wsServer authSettings subscriptions = WSAPI { wsAPI = streamData }
wsServer
::
(
IsGargServer
env
err
m
,
HasDispatcher
env
,
HasSettings
env
)
=>
WSAPI
(
AsServerT
m
)
wsServer
=
WSAPI
{
wsAPIServer
=
streamData
}
where
...
...
@@ -129,7 +128,7 @@ wsServer = WSAPI { wsAPIServer = streamData }
-- Sec-WebSocket-Key so we want to make that even more unique.
uuid
<-
liftBase
$
UUID
.
nextRandom
let
key
=
key'
<>
"-"
<>
show
uuid
liftBase
$
putText
$
show
$
WS
.
requestHeaders
reqHead
--
liftBase $ putText $ show $ WS.requestHeaders reqHead
c
<-
liftBase
$
WS
.
acceptRequest
pc
let
ws
=
WSKeyConnection
(
key
,
c
)
_
<-
liftBase
$
Async
.
concurrently
(
wsLoop
authSettings
subscriptions
ws
)
(
pingLoop
ws
)
...
...
Przemyslaw Kaminski
@cgenie
mentioned in commit
5660aec0
·
Oct 08, 2024
mentioned in commit
5660aec0
mentioned in commit 5660aec07ec5a0a0a5468f440092c1a8f57a864e
Toggle commit list
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