Skip to content

Commit

Permalink
Allow IPv6 for Livebook Teams (#2698)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleDsz authored Jul 3, 2024
1 parent 7f1c5f1 commit a82b046
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/livebook/teams/requests.ex
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ defmodule Livebook.Teams.Requests do
defp build_req() do
Req.new(
base_url: Livebook.Config.teams_url(),
inet6: String.ends_with?(Livebook.Config.teams_url(), ".flycast"),
headers: [{"x-lb-version", Livebook.Config.app_version()}]
)
end
Expand Down
5 changes: 5 additions & 0 deletions lib/livebook/teams/web_socket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ defmodule Livebook.Teams.WebSocket do
[]
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]

with {:ok, conn} <- Mint.HTTP.connect(http_scheme, uri.host, uri.port, opts),
Expand Down

0 comments on commit a82b046

Please sign in to comment.