Found solution to override transport of LiveView
This commit is contained in:
parent
ccf5a4daf0
commit
793c479cf0
1 changed files with 6 additions and 1 deletions
|
@ -24,7 +24,12 @@ import topbar from "../vendor/topbar"
|
||||||
|
|
||||||
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
|
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
|
||||||
let liveSocket = new LiveSocket("/live", Socket, {
|
let liveSocket = new LiveSocket("/live", Socket, {
|
||||||
longPollFallbackMs: 2500,
|
longPollFallbackMs: 2500, // Retirer ça pour définir en dure le transport
|
||||||
|
// Pour forcer à utiliser les websockets
|
||||||
|
// transport: WebSocket,
|
||||||
|
// Pour forcer à utiliser les Longpoll (Req HTTP)
|
||||||
|
// Nécessite de rajouter LongPoll dans les imports de "phoenix"
|
||||||
|
// transport: LongPoll,
|
||||||
params: {_csrf_token: csrfToken}
|
params: {_csrf_token: csrfToken}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue