admin.hostSetForeignPort( config as element(configuration), host-id as (Number|String), value as Number ) as element(configuration)
This function configures the specified domestic host to listen for communications from foreign hosts over the specified port.
http://marklogic.com/xdmp/privileges/admin/host
http://marklogic.com/xdmp/privileges/admin/host/{id}
const admin = require('/MarkLogic/admin.xqy'); const cfg = admin.getConfiguration() const hid = xdmp.host("master.marklogic.com") admin.hostSetForeignPort(cfg, hid, 7998) //Configures the specified host to listen for foreign communications over //port 7998.//Use admin.saveConfiguration to save the changes to the //configuration or pass the configuration to other Admin API functions //to make other changes.