@@ -11,14 +11,27 @@ defmodule Mediasoup.TransportListenInfo do
1111 :ip => String . t ( ) ,
1212 :protocol => :tcp | :udp ,
1313 optional ( :announcedAddress ) => String . t ( ) | nil ,
14+ optional ( :exposeInternalIp ) => boolean ( ) ,
1415 optional ( :port ) => integer ( ) ,
16+ optional ( :portRange ) => map ( ) ,
17+ optional ( :flags ) => map ( ) ,
1518 optional ( :sendBufferSize ) => integer ( ) ,
1619 optional ( :recvBufferSize ) => integer ( )
1720 }
1821
1922 @ enforce_keys [ :ip , :protocol ]
2023
21- defstruct [ :ip , :protocol , :announcedAddress , :port , :sendBufferSize , :recvBufferSize ]
24+ defstruct [
25+ :ip ,
26+ :protocol ,
27+ :announcedAddress ,
28+ :exposeInternalIp ,
29+ :port ,
30+ :portRange ,
31+ :flags ,
32+ :sendBufferSize ,
33+ :recvBufferSize
34+ ]
2235
2336 def normalize_listen_ip ( ip ) when is_binary ( ip ) do
2437 % { :ip => ip }
@@ -40,20 +53,25 @@ defmodule Mediasoup.TransportListenInfo do
4053 info
4154 end
4255
43- @ spec create ( binary ( ) | % { :ip => any ( ) , optional ( any ( ) ) => any ( ) } , any ( ) ) :: struct ( )
44- def create ( ip , protocol ) do
56+ @ spec create ( binary ( ) | % { :ip => any ( ) , optional ( any ( ) ) => any ( ) } , any ( ) , boolean ( ) ) :: struct ( )
57+ def create ( ip , protocol , expose ) do
4558 listen_ip = normalize_listen_ip ( ip )
46- struct ( __MODULE__ , Map . merge ( listen_ip , % { :protocol => protocol } ) )
59+
60+ struct (
61+ __MODULE__ ,
62+ Map . merge ( listen_ip , % { :protocol => protocol , :exposeInternalIp => expose } )
63+ )
4764 end
4865
49- def create ( ip , protocol , port ) do
66+ def create ( ip , protocol , expose , port ) do
5067 listen_ip = normalize_listen_ip ( ip )
5168
5269 struct (
5370 __MODULE__ ,
5471 Map . merge ( listen_ip , % {
5572 :protocol => protocol ,
56- :port => port
73+ :port => port ,
74+ :exposeInternalIp => expose
5775 } )
5876 )
5977 end
0 commit comments