mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-02-24 14:58:35 +08:00
Allow IPv6 for Livebook Teams (#2698)
This commit is contained in:
parent
7f1c5f18c5
commit
a82b04625d
2 changed files with 6 additions and 0 deletions
|
@ -267,6 +267,7 @@ defmodule Livebook.Teams.Requests do
|
||||||
defp build_req() do
|
defp build_req() do
|
||||||
Req.new(
|
Req.new(
|
||||||
base_url: Livebook.Config.teams_url(),
|
base_url: Livebook.Config.teams_url(),
|
||||||
|
inet6: String.ends_with?(Livebook.Config.teams_url(), ".flycast"),
|
||||||
headers: [{"x-lb-version", Livebook.Config.app_version()}]
|
headers: [{"x-lb-version", Livebook.Config.app_version()}]
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -29,6 +29,11 @@ defmodule Livebook.Teams.WebSocket do
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
transport_opts =
|
||||||
|
if String.ends_with?(Livebook.Config.teams_url(), ".flycast"),
|
||||||
|
do: Keyword.put(transport_opts, :inet6, true),
|
||||||
|
else: transport_opts
|
||||||
|
|
||||||
opts = [protocols: [:http1], transport_opts: transport_opts]
|
opts = [protocols: [:http1], transport_opts: transport_opts]
|
||||||
|
|
||||||
with {:ok, conn} <- Mint.HTTP.connect(http_scheme, uri.host, uri.port, opts),
|
with {:ok, conn} <- Mint.HTTP.connect(http_scheme, uri.host, uri.port, opts),
|
||||||
|
|
Loading…
Reference in a new issue