Skip to content

Instantly share code, notes, and snippets.

@enricop89
Created March 23, 2020 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enricop89/5a4ef01ef4246b23e0d7ff29cac27da9 to your computer and use it in GitHub Desktop.
Save enricop89/5a4ef01ef4246b23e0d7ff29cac27da9 to your computer and use it in GitHub Desktop.
React-native - Example of proxyURL
import React, { Component } from 'react';
import { View } from 'react-native';
import { OTSession, OTPublisher, OTSubscriber } from 'opentok-react-native';
export default class App extends Component {
constructor(props) {
super(props);
this.apiKey = '';
this.sessionId = '';
this.token = '';
}
render() {
return (
<View style={{ flex: 1, flexDirection: 'row' }}>
<OTSession apiKey={this.apiKey} sessionId={this.sessionId} token={this.token}
options={{ proxyUrl: "https://your-proxy-url.com" }}>
<OTPublisher style={{ width: 100, height: 100 }} />
<OTSubscriber style={{ width: 100, height: 100 }} />
</OTSession>
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment