You can directly use the official WebRTC libraries (
https://webrtc.org/native-code/development/).
https://github.com/Lalaland/DataChannelServer is a wrapper I worked on last summer to make it a bit easier (not complete by any means, but it at least gives you a sense of how the API works).