Skip to content

Conversation

@codewithtamim
Copy link
Contributor

@codewithtamim codewithtamim commented Jun 6, 2025

So in this pr I have added a new api for getting the core state running or not. I looked into the Instance struct in the Xray-Core core/xray.go file and found there is a running bool which returns if its running or not. So the issue was it was not exporting runnning. So first I did a contribution in main Xray core to add that feature which is now merged #4775 and then I added the same thing here in the client wrapper. and it looks like this

// Get Xray State
func GetXrayState() bool {
	return coreServer.IsRunning()
}

So in this pr I have added a new api for getting the core state running or not. I looked into the `Instance` struct in the `Xray-Core` core/xray.go file and found there is a running bool which returns if its running or not. So the issue was it was not exporting runnning. So first I did a contribution in main Xray core to add that feature which is now merged [#447](XTLS/Xray-core#4775) and then I added the same thing here in the client wrapper. and it looks like this

```go
// Get Xray State
func GetXrayState() bool {
	return coreServer.IsRunning()
}
```
@yiguodev yiguodev merged commit 020b8db into XTLS:main Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants