Teensy 4.1 nativeethernet browser get request

jun101

New member
Hello All,

I've searched a lot on the internet a way to get on teensy an url request from the browser of a computer connected through the ethernet.
Most results I get are examples and tutorials on how to set teensy as webserver which is not what I want to do.

What I'm trying to accomplish is to read any www url typed in the browser, then teensy(A) will read the request and forward this information via serial to another teensy(B).
This last teensy is connected to the internet through a PC. Then it will post/get the url and read the http/https answer from the server and send back to the PC(A) end finally the browser will display the webpage.

The setup looks like this:
PC(A)-Teensy(A)-Serial(10mbits)-Teensy(B)-PC(B)(with internet)

I've successufully written a firmware using the 2 examples included in the nativeethernet, UPDSendReceiveString and AdvanceChatServer
I'm able to run windows application such as UDP sender/receiver and Hercules on both PCs to send and read texts between them.

I've limited networking knowledge, so I don't even know if it possible to achieve what I presented.

Can anyone help me? Any suggestion is appreciated.

Thank you.
 
You could just read from one stream and write to the other. For really high data rates, you could also optionally add some flow control on the serial side. I don’t think you really need to dive into PPP.

Is your PC connected over USB serial to Teensy A? If so, same thing applies. Read/write from `Serial` and write/read to one of the hardware serial ports.

Am I missing something?
 
You could just read from one stream and write to the other. For really high data rates, you could also optionally add some flow control on the serial side. I don’t think you really need to dive into PPP.

Is your PC connected over USB serial to Teensy A? If so, same thing applies. Read/write from `Serial` and write/read to one of the hardware serial ports.

Am I missing something?

Teensy and computer are connected through the ethernet not via USB. What I basically do at the moment is forward TCP and UDP packet, when available, to the serial forming a sort of bridge. So what are you describing is correct but using the ethernet instead of USB serial.
One thing I struggle to understand is how to type any address in the browser and get the request without pointing to teensy's IP like when it acts as webserver.
Is there a particular setting or function to call to "listen" to the browser (firefox)?
 
It sounds like you need to configure your browser to use a proxy. In that case, I think you’d also need to write an HTTP proxy server for the Teensy.
 
It sounds like you need to configure your browser to use a proxy. In that case, I think you’d also need to write an HTTP proxy server for the Teensy.

Thank you for your inputs ;). I am taking that in consideration while searching for an alternative solution.
 
Back
Top