28
votes
Accepted
Implementing Local HTTP Server
The following guide shows how to conduct communication between nanohttpd, an http server for Java, and Mathematica. The result is a server that, if you go to its address in a web browser, displays the ...
14
votes
Implementing Local HTTP Server
The following is a sample implementation of a simple HTTP server in Wolfram Language code only:
https://github.com/arnoudbuzing/wolfram-server
You send it a POST request where the body data of the ...
13
votes
Connect to Socket opened by other applications
This is the best use of SocketConnect that I can think for now.
...
9
votes
How to show Plots or Graphics in mini MMA HTTP Server?
Very often SVG makes sense, it will scale well with magnification. This idea does not deserve a separate answer so additionally I rewrote the code in a more idiomatic style:
...

Kuba♦
- 135k
8
votes
Accepted
How to show Plots or Graphics in mini MMA HTTP Server?
You can get it to respond with images by doing the following:
...
8
votes
Implementing Local HTTP Server
Starting in Mathematica 12, there is a built-in function SocketListen that can start a web server and respond to HTTP requests.
...
5
votes
Opening a pipe with OpenRead
Use sockets. For example, set up a listening connection in shell with
nc -l 2222
Then in Mathematica
...
5
votes
How to set ZeroMQ subscribe channel in Mathematica?
I think this part of the interface is broken. From some digging I found: ZeroMQLink`SocketOptions`Private`setSockOptSingle which is called by ...
4
votes
Accepted
Using sockets to connect to a trading platform
Please try:
socket = SocketConnect[{"api.binance.com", 443}]
WriteString[socket, "GET /api/v1/time \n"]
message = SocketReadMessage[socket]
note the "\n" message ...
4
votes
Accepted
How can I resubmit data to a SocketConnect object without creating a new socket?
I have been grappling with this for a while and finally I realized the problem is not Mathematica. TCPHandler appears to kill the connection after the first ...
3
votes
Accepted
WriteString to TCP socket appears to be broken in Mathematica 12.3
I think there is a problem with your python TCP server implementation.
If you check the corresponding documentation, especially the example section, you may witness that the provided TCP client code ...
3
votes
How to run a wolfram-server safely on a VPS as a backend of a webpage?
People at Wolfram just let me know about the hidden sandbox option.
So, a safer way to run the Wolfram Engine as a back-end is:
wolframscript -sandbox
3
votes
Accepted
SocketConnect not connecting to web socket address
Sorry for the poorly formatted answer, it has been updated.
Since I am very new to web sockets, I didn't even understand the error. After some sleuthing, https://en.wikipedia.org/wiki/WebSocket, web ...
3
votes
How to set ZeroMQ subscribe channel in Mathematica?
Sorry for the late response. There is indeed a problem with ZMQ option management.
@b3m2a1 did a very good job at digging into the code for an answer. The expected input is a list of integer (list of ...
3
votes
How to set ZeroMQ subscribe channel in Mathematica?
https://www.wolfram.com/language/12/networking-and-system-operations/zeromq-publisher-model.html
...
2
votes
What crops the response from the SocketListen based web server?
It appears WriteString will return too quickly, so your message is closed in the middle of sending. In short, my current solution is to use an appropriate time to ...
2
votes
Accepted
TaskWait, SocketObject, and WolframScript
How can I create this socket through WolframScript and keep it running until the script is closed [...]?
For the server I am using I have this and it seems to do its job well.
...

Kuba♦
- 135k
2
votes
Accepted
Can Wolfram Development Platform communicate in real time?
There is now an experimental feature to communicate in real-time in Wolfram:
https://reference.wolfram.com/language/guide/Channel-BasedCommunication.html
It can be used to communicate between two ...
1
vote
Can Wolfram Development Platform communicate in real time?
You can connect to sockets with SocketConnect, but I'm not aware of a built-in way to bind a socket.
1
vote
Implementing Local HTTP Server
Yes (and using pure Mathematica or WolframEngine)
https://jerryi.github.io/tinyweb-mathematica/
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
socket × 23networking × 8
web-access × 4
webservices × 4
streams × 3
interoperability × 2
java × 2
asynchronous-processing × 2
real-time × 2
plotting × 1
performance-tuning × 1
export × 1
wolfram-cloud × 1
scripting × 1
windows × 1
python × 1
html × 1
data-acquisition × 1
security × 1
input-devices × 1
apifunction × 1
version-12.3 × 1