-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
gRPC APIs for list of inbounds and users #2745
Comments
You can use protoc and grpc plugin on your desired language to auto generate Protobuffers with any language for example for PHP the command to generate proto buffs will be something like this protoc \
--proto_path=xray/proto \ # proto files path - can be xray-core repo path cloned
--php_out=xray \
--grpc_out=./xray \
--plugin=protoc-gen-grpc=./grpc/cmake/build/grpc_php_plugin \ # path to grpc php plugin
xray/proto/HandlerService.proto \ # some .proto files
xray/proto/proxy/vless/inbound/config.proto \ # .proto files You need to have GRPC compiled, then it'll generate php files regarding to protobufs Final code use will be something like this $grpcOptions = [
'credentials' => ChannelCredentials::createInsecure()
];
$client = new HandlerServiceClient("{$server->ipv4}:{$server->port}", $grpcOptions);
$client->waitForReady(5 * 1000 * 1000); // microseconds
return $client->RemoveInbound(new RemoveInboundRequest([
'tag' => 'vless-tcp'
]), [], [
'timeout' => 5 * 1000 * 1000 // microseconds
]); Take a look at these: |
Thanks @amir-devman, I am familiar with gRPC, but there isn't an API available to retrieve a list of defined inbounds/outbounds/users. I'm looking for a method to access this specific list. |
HandlerService is all you need to look for inbound/outbound management
As I've looked into xray-core source code I've only found this helpful for managing inbounds/outbounds/users Only thing you can find on Project X document is ReflectionService API that only mentions what services are available which I hope this helps. |
@miladrahimi There's also another document with examples(golang): |
I was hoping for a method or API, perhaps named |
@Fangliding Since there is no "List of inbounds" implemented in the Xray gRPC, I think it's not completed yet. |
@miladrahimi |
This is an important feature. Planning.. |
After all, how do I add clients to VLESS incoming connections? Use the HandlerService from this file
|
There are gRPC APIs for adding, altering, and removing inbounds, outbounds, and users but I couldn't find any API for fetching the lists of defined inbounds, outbounds, or users, how can I fetch them?
The text was updated successfully, but these errors were encountered: