Send Sensor Data to send on node red server running on AWS server

Hi, With the help of node red tutorial. I was able to install the node red.

Could It be possible to send the Data of sensor through ESP8266 by using the public IP (alotted by AWS server) to be defined as MQTT server in MQTT node as well as in code?

Is it possible to send the sensor data using WebSockets?

Suggestion on this will be really helpful.

It is not clear which way you are trying to send the data. Where does the data come from and where are you trying to get it to?

However it is possible to connect to public MQTT servers from node-red.

Also you can easily have an MQTT server in the same computer that is running node-red.