As of May 31, 2023, we have updated our Code of Conduct.

Hot answers tagged

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 ...
C. E.'s user avatar
  • 69.5k
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 ...
Arnoud Buzing's user avatar
13 votes

Connect to Socket opened by other applications

This is the best use of SocketConnect that I can think for now. ...
rhermans's user avatar
  • 35.6k
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's user avatar
  • 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: ...
Carl Lange's user avatar
  • 12.9k
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. ...
Flux's user avatar
  • 346
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 ...
Daniel Genin's user avatar
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 ...
b3m2a1's user avatar
  • 46.3k
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 ...
Hans's user avatar
  • 946
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 ...
flinty's user avatar
  • 22.8k
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 ...
Dorian B.'s user avatar
  • 371
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
Fortsaint's user avatar
  • 2,020
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 ...
Ray Troy's user avatar
  • 1,279
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 ...
Dorian B.'s user avatar
  • 371
3 votes

How to set ZeroMQ subscribe channel in Mathematica?

https://www.wolfram.com/language/12/networking-and-system-operations/zeromq-publisher-model.html ...
Alexey Golyshev's user avatar
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 ...
Ben Izd's user avatar
  • 8,459
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's user avatar
  • 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 ...
Hristo Vrigazov's user avatar
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.
rhennigan's user avatar
  • 1,783
1 vote

Implementing Local HTTP Server

Yes (and using pure Mathematica or WolframEngine) https://jerryi.github.io/tinyweb-mathematica/
Kirill Vasin's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible