This commit introduces the initial implementation of the xmrig-proxy functionality. It includes: - A new `proxy` command to the CLI to start the proxy. - A new `pkg/proxy` package to encapsulate the core proxy logic. - A mock proxy service that simulates workers connecting. - The initial implementation of the XMRig Proxy API, with the `/` and `/workers.json` endpoints.
19 lines
304 B
Go
19 lines
304 B
Go
package config
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestConfig(t *testing.T) {
|
|
cfg := New()
|
|
assert.NotNil(t, cfg)
|
|
assert.Equal(t, 8080, cfg.HTTP.Port)
|
|
|
|
newConfig := New()
|
|
newConfig.HTTP.Port = 8081
|
|
cfg.Update(newConfig)
|
|
|
|
assert.Equal(t, 8081, cfg.Get().HTTP.Port)
|
|
}
|