How to set up a custom jetbrains://xyz end point in a plugin?
已回答
We'd like to pass some data from a proxy running in a browser to a plugin we develop.
How could we do define in a plugin a custom jetbrains://xyz end point that could be called from a browser?
请先登录再写评论。
Hi,
IntelliJ has the internal HTTP server running and you can create and register your request handlers with com.intellij.httpRequestHandler extension point. The default port is 63342. If the default port is occupied, 63342 + n will be used (n < 20). If still not possible to bind, any free port will be used.
See HttpRequestHandler, RestService, BinaryRequestHandler.
That's a helpful answer to a slightly different question - how to implement a web server within a plugin.
My question is how to map a custom jetbrains://xyz end point to an internal web server?
We want to have a fixed url and no potential issues with port collisions.
For example, in VSCode an extension could define vscode://xyz.plugin/etc routes. How to do that in IntelliJ?
Hi,
The "jetbrains://" protocol is handled by Toolbox application.
If it is acceptable in your case, there is an extension point: com.intellij.openapi.application.JBProtocolCommand.
Please see example implementations in the platform code and IntelliJ Platform Explorer.
See
HttpRequestHandler
,
RestService
,
BinaryRequestHandler
.
Looks like these are not available anymore, is it correct?
Are there other options to register a custom http handler to the default web server that platfrom is running?