Comments (5)
The following is a document for CAPI, but it internally uses remoteAddress
.
https://github.com/paullouisageneau/libdatachannel/blob/master/DOC.md#rtcgetremoteaddress
Retrieves the current remote address, i.e. the network address of the currently selected remote candidate. The address will have the format "IP_ADDRESS:PORT", where IP_ADDRESS may be either IPv4 or IPv6. The call may fail if the state is not RTC_CONNECTED, and the address might change after connection.
I think it would be good to search for ':' from the end and then split (like std::string::rfind
).
It doesn't seem like there was a single API that returns the hostname or port number.
If necessary, wouldn't it be better to consider adding one?
from libdatachannel.
Following C++ WebSocket Class use the same implementation as CAPI
optional<string> remoteAddress() const;
I'd just like to know, why the result string have a strange form of "::ffff:105.11.31.26:9204", expected to be "105.11.31.26:9204". The last one will be easily to split and interpret.
It is a bug inside?
from libdatachannel.
The format ::ffff:x.x.x.x
is used to maintain compatibility between IPv6 and IPv4, as far as I remember. For more details, I suggest referring to RFC 4291.
from libdatachannel.
Got it! Thanks!
from libdatachannel.
FYI this format is called IPv4-mapped IPv6 address. It can currently be returned by WebSocket::remoteAddress()
if you listen on IPv6+IPv4 and the remote client connects over IPv4.
from libdatachannel.
Related Issues (20)
- RtpHeader/Ssrc is not a member of 'rtc' HOT 2
- Issue of RtcpNackResponder incoming() HOT 2
- class "rtc::H264RtpPacketizer" has no member "DefaultClockRate" HOT 1
- [vcpkg] configure failed because 'Could not find a package configuration file provided by "libSRTP"' HOT 1
- Version 0.20.0 can not be build with usrsctp 0.9.5.0 HOT 1
- SIGABRT in IceTransport::TimeoutCallback with libnice HOT 6
- Compile with static msvcrt on windows HOT 2
- run the client-benchmark HOT 2
- Cross-compile for alwinner v3s HOT 2
- Adding and Removing Tracks Without Creating New Connections HOT 6
- `juice: Send failed, buffer is full` error in media-sender example HOT 5
- How to add tracks during negotiation HOT 1
- Add version macros
- receive audio in streamer example HOT 1
- Implementation in Codeblocks C++ HOT 4
- using in Local Network/localhost HOT 1
- Issue of RtcpNackResponder nack data HOT 4
- How to properly release resources in libdatachannel HOT 2
- vcpkg broken HOT 4
- Sending h264 message causes assertion in std vector HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libdatachannel.