What protocol does VS Code Remote use? - vscode-remote

As far as I can tell there's no docs on the protocol that the client and server communicate with. The FAQ specifies that it communicates over an SSH tunnel, but what is the protocol that is sent between client and server?
Is it JSON/Protobuf/XML/etc.? What do the structure of the messages look like? Is there documentation but I just haven't been able to find it?

Related

How to Setup a bidirectional connection between a Blazor Server and an embedded c device?

I'm quite new to .net. I have a Blazor Server application and an embedded linux device with a c application.
Now I want to send different commands from the server to the embedded device and read the results.
What is the best practice here. Could you point me towards an elegant solution?
Is a simple tcp socket (embedded device as client, server as server) sufficient or do I need something like libwebsocket to accomplish my goal?
Regards Martin.

Send memory variables from Server to Client in open62541

I'm trying to create a bridge in C Language that uses two protocols : OPC-UA and MODBUS.
Between the client and the bridge I used the protocol open62541 to ask for some data of any type. When the bridge receive the request, the memory requests start, from the brigde with the protocol MODBUS, to the MODBUS server, that should send back those memory variable asked.
My problem is that I cannot find any way to see the point in the code, where the Server recieve the Client request.
I need to find how to send those memory variables back from the server to the Client.
I would be glad if someone has the solution.
By guessing I assume you mean a ReadRequest and you want to find out where this read request is handled in the server?
It could be this one: Service_Read
https://github.com/open62541/open62541/blob/71e9a44d1aec5bc0cce465c8daefe47883b25f6c/src/server/ua_services_attribute.c#L394
Or also the Operation_Read:
https://github.com/open62541/open62541/blob/71e9a44d1aec5bc0cce465c8daefe47883b25f6c/src/server/ua_services_attribute.c#L394
you are looking for?!

Building an own socket API to send UDP packets over LoRaWAN

I'm building a LoRa network where the server and the end-device need to communicate using a protocol which normally transmits data via UDP. Due to the fact that these two protocols act totally different I need to find a way to combine those two.
One solution I found is to create my own socket API which provides send, receive, bind, ... functions. But here I'm actually struggling.
In which scope do I need to write my socket? Is it enough to just edit the functions and rely on the other given parameters such as the address families? Or must I define my own AF and if so where/how is this achieved.
I'm looking forward to your answers / ideas.
According to the LoRaWAN specification and my limited experience, LoRaWAN is not suitable for such situation. If you still wanna use UDP packets over LoRaWAN, here are some tips for your question.
In which scope do I need to write my socket?
You may use sendUnconfirm function since this function does not need ACK from gateway. And port in LoRaWAN could play the role of bind in UDP socket.
Is it enough to just edit the functions and rely on the other given
parameters such as the address families?
LoRaWAN server has its own features and structure. Usually, a LoRaWAN server is consist of packet_forwarder, LoRaWAN server and LoRaWAN application server. You may use these features to build you own application on LoRaWAN applicaiton server. It could save your a lot of time.
It is highly recommended to read LoRaWAN specification (Get it here) and TTN LoRaWAN wiki to help you get a better understanding in LoRaWAN.

TOR Peer-To-Peer Application in C

i am writing a peer-to-peer chat application in C and would like to extend it using TOR as transport medium. Since i have never used TOR before and i roughly know how it works; i have no idea how to achieve that.
By all means, both clients are listening for connection requests on a specific TCP port (defined by user). What do i have to do, so that e.g Client A connects to Client B (assuming both have TOR client installed)? Due to some research i found out that i have to connect to localhost:9050 where the TOR client is listening and then i think i have to craft a SOCKS4/5 pdu to connect to the proxy??
If that's right, could someone explain me this in detail? Furthermore are there any libs i can use for connecting to a socks proxy (for C, OS: GNU/Linux, BSD)?
Thanks in advance!

Behind NAT to behind NAT connection

I've come across an interesting problem. Basically I have 2 mobile phones that are both behind NATs. I want to communicate directly between the 2 devices using UDP.
I know if I initiate a connection from the phones to a server then I can push data back down that connection to the phone (ie send it back from the same port that received the message to the same ip and port that it was received from). So I can easily communicate between the 2 devices by connecting both phones to the server. Then sending data to the server and having it re-routed back to the phones. This bypasses any NAT traversal issues I may come up against.
However I would rather just use the server to point the 2 devices at each other and then let them communicate directly. How would I go about doing this? Is it possible without using something like uPnP?
Any help would be much appreicated!
Edit: I found this document http://www.brynosaurus.com/pub/net/p2pnat/ It looks like hairpin translation is what I'm after but it doesn't look to be widely supported. I wonder how good mobile ISP's support for UPnP is?
What you're looking for is UDP hole punching, see e.g. http://en.wikipedia.org/wiki/UDP_hole_punching
The basic idea is simple, you tell each endpoint the ports to use, and they start sending udp packets. The NAT'ing devices will set up a traversal rule when they see the first outgoing packet, and then the next attempt from the other end will match this traversal rule.
You need a mediator server, so the clients can tell where they are. Then one opens a server by uPNP, and the other connects to it.

Resources