New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@tuia/eureka-client-ts

Package Overview
Dependencies
Maintainers
13
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tuia/eureka-client-ts

latest
npmnpm
Version
0.3.8
Version published
Maintainers
13
Created
Source

eureka-client-ts


// typescript
import Eurekaclient from 'eureka-client-ts'

// commonJs
const Eurekaclient = require('eureka-client-ts').default

const client = new Eurekaclient({
  port: 3000,
  appName: 'huhu',
  services: ['duiba-manager-web'],
});

(async () => {
  await client.start();
  global['eureka'] = eureka;
})();

const { ip, serviceGroupKey } = getProxyInfoFromReq(req)  // koa 参数为ctx.req
global['eureka'].getHost('duiba-manager-web', ip, serviceGroupKey);

start 启动 eureka

stop 停止 eureka

getHost<name: string | number, filterGroup?: string>

优先使用本地, 其次查询有配置项的host,其次查询同网段的,都不满足,随便取一个

getProxyInfoFromReq<req: Response>

获取客户端IP(开发环境优先访问本地),以及多场景的cookie

getAllEurekas 获取所有eureka

getAllHostName 获取所有实例下的host

Keywords

eureka

FAQs

Package last updated on 02 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts