Skip to content

Comments

Core: Export the running bool#4775

Merged
RPRX merged 1 commit intoXTLS:mainfrom
codewithtamim:main
Jun 6, 2025
Merged

Core: Export the running bool#4775
RPRX merged 1 commit intoXTLS:mainfrom
codewithtamim:main

Conversation

@codewithtamim
Copy link
Contributor

So in this contribution I did a small change and exported the running bool. code follows

func (server *Instance) IsRunning() bool {
	return server.running
}

But why ? right?
the reason behind it is I wanted to implement this feature in libXray but when I went on I saw running wasnt like exported and I cannot access that. So to have a api to check current core state in libXray we need it. For reference another xray wrapper like to mention AndroidLibXrayLite has the same feature to get core state. So choosed to have it also in libXray.

So in this contribution I did a small change and exported the running bool. code follows
```go
func (server *Instance) IsRunning() bool {
	return server.running
}
```

But why ? right?
the reason behind it is I wanted to implement this feature in [libXray](https://github.com/XTLS/libXray) but when I went on I saw `running` wasnt like exported and I cannot access that. So to have a api to check current core state in libXray we need it. For reference another xray wrapper like to mention [AndroidLibXrayLite](https://github.com/2dust/AndroidLibXrayLite) has the same feature to get core state. So choosed to have it also in libXray.
@RPRX RPRX changed the title Exported the running bool Core: Export the running bool Jun 6, 2025
@RPRX RPRX merged commit d0c80fc into XTLS:main Jun 6, 2025
39 checks passed
maoxikun pushed a commit to maoxikun/Xray-core that referenced this pull request Aug 23, 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.

3 participants