Rhino plugin along with Golang code

There is a Golang source code. It’s a server which accepts HTTP requests and returns HTTP responses.

It’s intended to develop a Rhino plugin to:

  1. Launch the Golang server. Maybe just run the compiled executable.
  2. Send HTTP requests and receive HTTP responses.
  3. Preprocess HTTP requests and postprocess HTTP responses.

The decision-making is being done right now about which approach to take for plugin development. Options are:

  1. Grasshopper plugin development
  2. RhinoCommon .NET SDK
  3. C++ SDK
  4. Rhino.Python scripting
  5. …?

Which option would be more suitable for the case of Golang server? Is it even feasible?

When making HTTP requests to a server, it typically doesn’t matter what language the server is written in. Web browsers make requests to all sorts of different servers written in many different programming languages.

Rhino plug-ins, Grasshopper components and python scripts are all capable of making HTTP requests. I believe there are even Grasshopper components out there that support making HTTP requests without any extra programming effort.

1 Like

Alright. Makes sense.

Just a reminder that our server would be running locally and would be executed/launched by the Rhino plugin itself.

There are just some concerns I need to double-check:

  • Regarding launching/executing the Go server. Are plugins able to run executables?
  • Regarding the port at which the Go server would be listening. I think we need to try out the allowed ports from a pool and pick one which is not already used by any other app. Am I right?



Typically you’d pick a port number over 1024 that you can be confident about isn’t in general use by other software. You could try something like port 7123 or 5976 or 4422 etc.

Pick one and stick to it, will make creating documentation easier too.

1 Like